Thank you for your question,
The IRS treates abandonments and foreclosures as sales. This means that you can be exposed to two kinds of tax.
Capital gains tax
debt cancellation income
And in the case of a rental unit, recapture tax on accumulated deprectiation.
1. for your primary residence, because of the "Mortgage Debt Forgiveness Act", you can exclude all of any debt cancellation debt income by using form 982. If this is from a non-recourse loan, then there is no debt cancellation income, but you can still be exposed to capital gains.
2. If box 4 is greater than box 2, there is no debt cancellation income, but you may have a capital gain.
3. If box 4 is greater thant box 2, complete schedule D.
4. So for a recouse loan for your primary residence you would use Schedule D to determine any capital gain, and form 982 to exclude the debt cancellation from income.
Form 982: http://www.irs.gov/pub/irs-pdf/f982.pdf
Schedule D: http://www.irs.gov/pub/irs-pdf/f982.pdf
NOTE: even if you have a capital gain on your primary residence you will likely be able to exclude a portion or all of the capital gain form capital gains tax. If you both lived in and owned the property for 2 of the past 5 years, you can exlcude 500,000 of capital gain from capital gains tax, if you file a joint return; and 250,000 if you file a return in anyother status. If you did not live in the property and own it for two of the past five years as your primary residence, then you would at least be able to take a reduced capital gain exclusion, which may still be able to cover any capital gain form such an activity.
For rental property you are exposed to debt cancellation income, capital gains, and recapture tax. However you are allowed to adjuste the debt cancellation and the depreciable basis of the porperty using the same, but seperate form as you used for the primary residence, to the extent of insolvency.
You repor the "sale" and determine your recapture using the following form: http://www.irs.gov/pub/irs-pdf/f4797.pdf
You will also require schedule D as provided above.
And form 982 also provided above.
Any capital gains would be taxed at 15 percent
Any recapture tax would be taxed at 25 percent
Any debt cancellation income would be taxed at your marginal rate.