The Mortgage Forgiveness Debt Relief Act of 2007 generally allows taxpayers to exclude income from the discharge of debt on their principal residence. Debt reduced through mortgage restructuring, as well as mortgage debt forgiven in connection with a foreclosure, qualify for this relief.
This provision applies to debt forgiven in calendar years 2007 through 2012. Up to $2 million of forgiven debt is eligible for this exclusion ($1 million if married filing separately). The exclusion doesn't apply if the discharge is due to services performed for the lender or any other reason not directly related to a decline in the home's value or the taxpayer's financial condition.
The following link is to the IRS, which provides additional information that you should read: http://www.irs.gov/newsroom/article/0,,id=174034,00.html