Previously, homeowners who paid less than their original mortgage required could only avoid a significant tax liability if they could show that they were insolvent, which was complicated and sometimes impossible. The Mortgage Forgiveness Debt Relief Act of 2007, however, makes an exception for certain situations involving mortgages. The Act permits borrowers to exclude from income amounts that are forgiven on the borrowers principal residence. The Act does not apply to investment properties or second homes, and it only applies to residential mortgages. It does not apply to credit cards or car loans. The exclusion is also limited to $2 million ($1 million if married and filing separately).
You may want to consult a tax attorney in a foreclosure situation to find out your liabilities.