Whether you can take two summer school classes to pass 8th grade depends entirely on your school's policies. Some schools might allow it, while others might have different requirements or limits on the number of courses you can take during summer school.
You absolutely need to talk to your school counselor or a school administrator. They are the only ones who can tell you definitively what's possible in your specific situation.