If person on H-4 is studying and H-1 holder goes back to india

If H-4 visa is valid upto 2 more years and person on H-4 is studying in usa university and have applied for COS to F1 and meanwhile the H-1 holder spouse goes back to india for few months then does H-4 holder also has to go back with H-1 holder or the H-4 visa holder can stay in USA and continue his studies untill COS or course completion?

If the H-1 person leaves US like this, then the H-4 person should also leave US. The dependent can stay back in US only if the H-1 holder is in US or has left US for a short trip.

If H-4 person wants to continue studies then move to F-1.