The following article was published by the IRS.

real estateThe IRS has some good news for taxpayers who are selling their home. When filing their taxes, they may qualify to exclude all or part of any gain from the sale from their income.

Here are some things that homeowners should think about when selling a home:

Ownership and use
To claim the exclusion, the taxpayer must meet ownership and use tests. During a five-year period ending on the date of the sale, the homeowner must have owned the home and lived in it as their main home for at least two years.

Gains
Taxpayers who sell their main home and have a gain from the sale may be able to exclude up to $250,000 of that gain from their income. Taxpayers who file a joint return with their spouse may be able to exclude up to $500,000. Homeowners excluding all the gain do not need to report the sale on their tax return.

Losses
Some taxpayers experience a loss when their main home sells for less than what they paid for it. This loss is not deductible.

Multiple homes
Taxpayers who own more than one home can only exclude the gain on the sale of their main home. They must pay taxes on the gain from selling any other home.

Reported sale
Taxpayers who don’t qualify to exclude all of the taxable gain from their income must report the gain from the sale of their home when they file their tax return. Anyone who chooses not to claim the exclusion must report the taxable gain on their tax return. Taxpayers who receive Form 1099-S must report the sale on their tax return even if they have no taxable gain.

Mortgage debt
Generally, taxpayers must report forgiven or canceled debt as income on their tax return. This includes people who had a mortgage workout, foreclosure, or other canceled mortgage debt on their home. Taxpayers who had debt discharged after December 31, 2017, can’t exclude it from income as qualified principal residence indebtedness unless a written agreement for the debt forgiveness was in place before January 1, 2018.

Possible exceptions
There are exceptions to these rules for some individuals, including persons with a disability, certain members of the military, intelligence community and Peace Corps workers.

Worksheets
Worksheets included in Publication 523 can help taxpayers figure the adjusted basis of the home sold, the gain or loss on the sale, and the excluded gain on the sale.