Deductions & credits

Sorry.  The down payment and mortgage balance doesn’t figure into it.  Simply sales price - cost is the gain or loss.