If your home was foreclosed on or repossessed, you have a sale.
You figure the gain or loss from the sale in generally the same way as gain or loss from any sale. But the selling price of your home used to figure the amount of your gain or loss depends, in part, on whether you were personally liable for repaying the debt secured by the home.
See Publication 523 for more information.
Form 1099-A and Form 1099-C. Generally, you will receive Form 1099-A, Acquisition or Abandonment of Secured Property, from your lender. This form will have the information you need to determine the amount of your gain or loss and any ordinary income from cancellation of debt. If your debt is canceled, you may receive Form 1099-C, Cancellation of Debt.
Questions and Answers on Home Foreclosure and Debt Cancellation (http://www.irs.gov/newsroom/article/0,,id=174034,00.html)