Unless there are minors under 18, the law cannot control who gets to stay in a house, and a judge is unlikely to, either. If a divorcing couple without children under 18 cannot work out who stays and who leaves, a judge might order the sale of the property. You should try to avoid that outcome, because court-ordered sales of real estate are rarely beneficial. If the house must be sold, you should have a realtor sell it so that you can get the best price. You will not get the best price in a court-ordered sale.