Getting a divorce could certainly mean that you need to sell your home. If you and your spouse own the home together and it is marital property, then it is subject to property division. Many couples will opt to sell their homes at this point because the division is easier when they just have to split up the money that they earned in that sale.
But the fact that many people choose this route doesn’t mean it’s the only option there is. In some cases, one person wants to keep the house, and they will buy out the other person’s share. In other cases, the divorced couple will simply keep owning the home jointly, even after the marriage has ended. If they are both on all of the paperwork, they can still legally own the home, and there is no requirement that they have to be married to do so.
Why would people choose these options?
The key is just to think of the specifics of your situation. What are your goals for the future, after the divorce? What is the best option for all involved?
For example, perhaps you and your spouse have children who are in high school. They are going to graduate and go to college in the next few years. Making them move at this time could be jarring, especially if they have to switch school systems. You may consider jointly owning a home with your ex for a few years so that the children can live there until they graduate, and then the two of you can sell it.
This is just one example, but it shows why it is important not to assume anything about divorce and to consider all of the legal options at your disposal.