Depending on the circumstances, you may be able to get a temporary order (possibly after attempted mediation) that establishes a status quo re: custody, visitation, etc., until the divorce case is finalized. However, not all judges may grant them, and it may work better to have a consent agreement, rather than just having the judge decide. Also, it is not clear whether you have a family law attorney representing you; if not, I advise that you hire one quickly. Good luck.
No, you do not have to sleep on the couch while the divorce is ongoing as the only way to see your children. However, if you want to have significant custodial time or rights when the divorce is over, I recommend you do not move out until there is a temporary order in place which designates a temporary custody schedule which you are comfortable with, because temporary arrangements can set a precedent for final schedules.
An attorney-client relationship is not created by this communication. My advice is meant to be helpful as the start of a discussion online and not to be a guide for your final decisions. In general, and without knowing all of the facts of your situation I am able to give only limited, and possibly inapplicable, advice. Please consult a local attorney personally.
First, do not leave the house, even when you may ultimately want to leave, unless in danger. Get something in return for surrendering the temporary use of the home. Visit your children's teachers and explain what is going on; if you have no history with the teachers, explain why and that in the future, you will be involved. If interim visitation can not be agreed, and no history of violence, so state in your petition or answer and arrange an interim order or agreement for visitation.
Sign up to receive a 10-part series of useful information and legal advice about the divorce process.