When a couple decides to end their marriage, it doesn't automatically follow that one spouse will pack his bags and move out. He's probably contributed to the home's mortgage or rent payments over the years just as the other spouse has; therefore, both have an equal right to live in the home. Unless they come to an agreement, both spouses can stay in the home until the court orders someone to move out -- and courts are not usually quick to do this.
Pendente Lite Orders
After either spouse has filed for divorce, both parties have the right to file pendente lite motions with the court, asking a judge to issue orders that apply only until the divorce is final. When the court issues a final decree, pendente lite orders might carry over into the decree or new terms supersede them. You can file a pendente lite motion for exclusive occupancy of the marital home, asking a judge to order your spouse to move out while your divorce is pending. However, you'll have to give a very good reason for the judge to order your spouse out of his own home.
In most states, a court will order exclusive occupancy of the marital home only if one spouse is abusive. His behavior must be extreme enough that it places the family in peril. Actual physical violence is not always necessary. If your spouse threatens it often enough that you and your children are living in fear, this is usually sufficient. However, you'll need proof for the court. If you have to call the authorities because you feel like you or your children are in danger, the police reports would provide acceptable documentation. If your spouse has harmed you or the children, you can provide doctors' reports and photos of your injuries. If he's causing you or your children mental anguish, visit a therapist and create a record of it. You can also use the testimony of individuals who have witnessed his behavior.
If you feel like you need immediate protection, you can go to the police or your local court and ask for a domestic violence restraining order. This will also remove your spouse from the home, but it may be for only a limited time. Most states issue temporary restraining orders to protect you in the short term, then set a hearing date in a couple of weeks so your spouse can defend himself against your accusations. If your spouse successfully convinces the judge he's innocent, your temporary restraining order will be dismissed. Your spouse can move right back in again. However, proof you tried to apply for a permanent restraining order, coupled with other evidence, might be enough to convince a family court judge to award you pendente lite occupancy of the marital home.
When One Spouse Voluntarily Leaves
The situation changes a bit if your spouse moves out then decides he wants to return home. He's established a new status quo by vacating the home and some states will grant you an order that prevents him from moving back in without requiring you to prove abuse.
Residency After Divorce
Courts sometimes award the marital home to one spouse after the divorce, without including the home in property division. This is a "deferred sale" of the home and often requires continued joint ownership, even though only one spouse is living there. This sort of arrangement has much more to do with the children than with domestic violence or abuse. Judges tend to order a deferred sale if they feel it would be cruel to force the children to relocate, such as if a high school student was forced to move to a new school district before graduating with his friends. The custodial parent is permitted to stay in the home post-divorce with the children. Deferred sales are usually limited to a period of a few years, until circumstances change and it's more feasible for the children to move.