What should you do with your home? Your spouse just asked you for a divorce, and that’s the first question that pops into your mind.

When it does, you can see two things. First, your marriage has been over for a long time, even if your spouse has just asked for a divorce now. You’re not even that sad to see that marriage technically end. You both need a chance to move on and you understand that.

Second, you really do love the home. That’s what you always dreamed about, and it’s what you got. Do you have to lose that just because your marriage is ending? What options do you have?

Below are four main ones to think about:

1. Sell the home, make a profit and split up that money

This does mean you lose your house, but it is the easiest way to do things, in many senses. If your home is worth more than you owe, you get a nice little financial gain right at the end of the marriage. Many people use it as a down payment on a place that they pick out for themselves.

This can work even if you won’t make a profit. You and your spouse have to split up the debt. While that’s not ideal, it is one way to move forward.

2. Buy the home from your spouse

You and your spouse bought the house together and you each have a right to it. You can refinance the house, get your own mortgage and then buy it from your spouse and yourself. This moves the home and the loan into your name alone. You do have to pay your spouse whatever his or her share would be worth, though, so this is a significant financial investment. However, it does mean you keep the home that you love.

3. Share the house with your ex

You don’t have to live in it at the same time. Maybe you want to keep it so that the children can live there, spending alternating weeks living in it when you each have custody. You do need another place for the off weeks, but you and the kids don’t lose your home.

4. Wait for the children to go to college before you sell

If you and your spouse both look at the house as an investment, you may be able to reach an agreement where you keep the home as long as the children are young. When they grow up and head off to college, the value will have gone up, and you can then sell the home and make even more.

Your options

What is right for you? It all depends on many factors, but the key thing is to know what options you have so that you understand exactly what legal steps to take.