The Mortgage Forgiveness Relief Act of 2007 was passed by Congress to avoid additional financial hardship that some homeowners might experience due to a foreclosure or short sale. The law affects mortgage relief that occurs from January 1, 2007 to December 31, 2012.
Normally, IRS considers partial or total debt forgiven by a lender to be treated as ordinary income. This not only affects foreclosures but even short sales where only part of the debt is forgiven would trigger additional taxes for the homeowner. There are exceptions that apply such as bankruptcy and insolvency.
The forgiveness is only applicable to taxpayers' principal residence and only acquisition debt used to buy, build or improve the home. The additional cash taken out when refinancing a home will not be eligible for the relief unless it is used for capital improvements.
The lender is required to submit a 1099 form to IRS and provide the homeowner a copy who will file the forgiven amount on Form 982 as part of their 1040 tax return. How this affects your individual situation may differ due to other circumstances and advice from a tax professional is recommended.