M-MTax
Level 12

Get your taxes done using TurboTax

Your mortgage payoff isn't part of your gain computation so disregard it.

Sales price minus your basis = your gain

How much you netted after your mortgage was paid off doesn't matter for tax purposes.