If you’ve owned and lived in your home for 2 of the 5 years prior to selling it, you can generally exclude up to $250,000 of the gain from your income. 1 ($500,000 on a joint return in most cases).
You are not eligible for this exclusion if you sold another principal residence within the past 2 years and excluded the allowable gain from your income.
If you can exclude ALL of the gain from the sale of your primary residence, you don’t need to report the sale on your tax return.
If you have a gain on your principal residence that exceeds the allowable deduction, it is taxable.
You can’t deduct a loss from the sale of your primary residence.
Special rules may apply when you sell a home, (See IRS Publication 523, “Selling Your Home,” for details.) if you’ve received the first-time homebuyer credit.