If you are selling or thinking of selling your home or rental property, the IRS has special resources to keep into consideration.
Selling your home
You can claim a capital gain exclusion of up to $250,000 (single) or $500,000 (married filing jointly), if you owned the home and lived in the main home for the last two years.
Note that the loss is not deductible.
Note that you might receive a 1099-S Proceeds from Real Estate for the total sales amount. Note that there are deductions like the sale expenses (i.e. real estate commissions) and you should consider your basis (cost of the property) to calculate the potential capital gain or loss.
Selling your home – Guidance – https://www.irs.gov/pub/irs-pdf/p523.pdf
Selling rental property
For rental property, there is no capital gain exclusion and the capital gain is calculated similarly (sale proceeds – cost of the property + accumulated depreciation – sale expenses). Also, you should consider any potential loss carry forward from previous years if applicable to this case.
Selling rental property – Guidance – https://www.irs.gov/pub/irs-pdf/p544.pdf