There are several factors which can determine the answer.
If there are children of the marriage, then the primary caregiver will be able to stay in the home.
If there are no children, and the home was owner by a party before the marriage, then the non-owning party will be expected to vacate.
If the parties co-own the property and cannot agree who will stay in the home, then the Court will make that decision. Pending the final decision after trial (if the parties do not settle), a party can ask the Court for a temporary order granting them possession of the home.
Keep in mind, that if the home is co-owned and you want to keep the home, you must be able to afford it. Not only may you be required to keep up with payments on your own, but will also likely have to give your spouse a pay-out for their own interest in this property.
If you are thinking about a divorce and need legal guidance, give us a call at (718) 725-9601 for a free consultation.