Deductions & credits

Only if you had a gain on the sale of the home would it need to be reported on a tax return.

Or if you received a Form 1099-S for the sale then it has to be reported on your tax return, gain or loss.