However, relationships do go south. People go in different directions.
And if they have a major financial obligation like a mortgage or even clear title to their house, it can't be divided down the middle.
Someone either gets it or they dispose of it in some way.
Depending on the animosity (and other issues) there can be serious challenges to selling. Obstacles like agreeing on a listing price, ability to show to prospective buyers, open houses, etc.

I am not an attorney. Disposing of assets like a house is definitely something to discuss with an attorney.
If both individuals are on an existing mortgage then walking away is not the easy escape. Talk with your attorney as "giving the house to the other party" may not free up a mortgage obligation.
The key is seek the advice of an expert attorney and put together a plan. Selling a house at any time is stressful...in this situation the pressures are greater.
However, if selling your house is a first step which you agree on, let me help you.
Although this is a very serious topic I end with what I consider common sense advice.... "Get rid of the house then the spouse!"