The Court will usually order one party to pay a debt, and indemnify and hold the other party harmless from the responsibility of the debt. This order however, is between the two parties only, and does not effect the third party creditor. That means that if the obligated spouse fails to pay the debt, the creditor can still come against the released spouse in collection. If this happens, you have a right to get a judgment against the obligated spouse and collect your costs.
The Court will consider many factors in dividing the debts, including the length of marriage, the economic circumstances of each party, the terms of spousal maintenance, if any, and any other relevant factor.