I have many clients who purchase homes with their spouse or common law partner. Some have been together a long time and have owned multiple properties together; some are recently merging their finances; some are moving in together for the first time. None of them wants to think about what could happen if they break up.
If you own as joint tenants (which means that you both own the whole house and the survivor takes everything if one partner dies), and you break up, you can obviously agree to sell the house jointly, or one partner can buy out the other. Regardless of whether you agree on what each of you is owed, I would always recommend seeing a family lawyer to be sure you know your rights.
But what happens if one party wants to sell, and the other is refusing? In that case, there is a specific court action called partition and sale, where a judge will order a house listed with a particular agent, dictate the terms of the listing, including its length, state the minimum price that can be accepted, and essentially order everything about the sale. If you are on title to a property and your partner is refusing to sell or buy you out, this option can work to let you move on with your life.