Investors & landlords

mortgages and refinancing have no effect on your gain.  your gain is the selling price of $440K less selling costs less your tax basis which would seem to be the sum of the purchase price and closing costs plus the cost of any capital improvements. the institution handling the closing will issue a 1099-S (on or before 1/31/2023) showing the full sales price. and that's what you'll have to use on your tax return.  if it's been your principal residence for at least 730 days during the period that starts 5 years before the sale you are entitled to exclude for federal purposes up to $250K of the gain. I'm assuming you haven't remarried)