Oftentimes, the person who continues to reside in the home is the person who must pay the mortgage. In many cases, it makes more sense for the parties to sell the house and split the equity that has come from that sale to eliminate the mortgage.
If it is a situation where one party pays alimony to the other party, part of their alimony payment may very well be the mortgage. Like any other examples of debt during marriage dissolution, there are a number of ways to handle it depending on the nature of the separation.