Deductions & credits

yes you have to report the sale.  mortgages have nothing to do with gain or loss.

 

basically gain/loss is selling price less cost of sales less acquisition cost reduced by depreciation taken or that should have been taken.

 

the 1099-C is income from debt cancellation that does not affect gain. you can use form 982 to reduce or eliminate the taxability of the discharge. this is a little technical so you may want to consult a pro.

https://www.irs.gov/pub/irs-pdf/f982.pdf