Deductions & credits

The mortgage you had on the home that is sold is not relevant in computing the gain or loss on the sale.

 

Gain or Loss = Sales Price minus Selling expenses minus Adjusted Basis of the Home (Purchase price plus the cost of improvements to the home prior to the sale)