Family Law Questions? Ask a Family Lawyer Online.
You are not liable to the lender directly. But the court could order you to pay the mortgage or refinance the home to fairly split the assets. But if the mortgage was defaulted, it would do nothing to you and your credit. The bank can't come after you personally. But the judge can order you to pay it for a period of time (usually if you stay in the house or neither of you wants the house) and if you don't, your spouse could try to have you held in contempt for refusing to obey the court's orders.
But if you both agree on division of assets and you don't want the house... there is no legal recourse against you for the bank.