Santa Barbara Association of REALTORS®: "RECOURSE DEBT Example Two: If the amount realized at the foreclosure sale is more than what the lender is owed, there will be no forgiveness of debt and, thus, no ordinary income to the taxpayer. 1. The unpaid principal of the recourse debt is $300,000; 2. The fair market value of the property is $400,000; 3. The taxpayer's adjusted basis in the property is $200,000. Step one: FMV ($400,000) less taxpayer’s adjusted basis ($200,000) results in capital gains for the taxpayer. FMV $400,000 Less Adjusted Basis $200,000 Capital Gains $200,000 Step two: The debt is fully paid (since the FMV exceeds the loan amount) resulting in no forgiveness of debt income. Q 7. How is the amount realized (taxable income) calculated for a “nonrecourse” debt in a foreclosure? A If the debt is nonrecourse, meaning the owner is not personally liable for any deficiency (beyond the value of the property), the amount realized is the difference between the greater of the foreclosure proceeds or the entire outstanding debt and the adjusted basis of the property. This amount is treated"
This is courtesy of the California association of Realtors legal dept.