July, 20, 2026
Selling a home can be a tax win, but how do I avoid a tax surprise? I will explain the key federal tax rules homeowners should understand before they sell, including the principal residence exclusion, how gain is calculated, when reporting may be required, and where special situations can change the answer.
In determining if selling your home will result in a taxable gain, the seller must take into account several factors. The original purchase price, home improvements, the selling price, rental history and prior depreciation all play a role in determining if your home sale will result in additional tax owed on your tax return. The range of outcomes can vary dramatically depending on how the home was used and what factors apply to an individual’s situation. The most important factor is likely the federal home sale tax exclusion.
The Internal Revenue Code allows a taxpayer to exclude up to $250,000 of gain, or up to $500,000 for certain married couples filing jointly, on the sale or exchange of their principal residence. In order to qualify for the exclusion, the general home seller must meet the following criteria:
For circumstances surrounding divorced or separated couples, homes that have been used as rental property, or homes used for business may have additional complications that may limit the exclusion amount. See the “Where Home Seller’s Get Surprised” section below and IRS Publication 523 for additional information on these circumstances.
The key to calculating your taxable gain is to remember that your selling price isn’t your gain, but merely a starting point. The basic calculation is generally as follows: Starting from the selling price, subtract any selling expenses, and subtract the adjusted basis of the home to obtain your Gain or Loss.
Definitions:
Selling Price: The agreed upon selling price of the home.
Selling Expenses: Costs to close the sale (commissions, expenses related to sale, etc.).
Adjusted Basis: The original purchase price of the home, plus expenses related to qualified improvements to the home (for example: new roof, new room, upgrading kitchen, etc.).
To give you an example of how this would work in practice, let’s go through a hypothetical scenario. John and Linda sold their home for $850,000, with selling expenses of $20,000. They meet the personal residence exclusion criteria, and are married, filing jointly. They originally bought the home for $400,000 and had qualified improvements of $10,000. They would calculate their gain as follows:
Because they meet the personal residence requirements, they can exclude up to $500,000 of their gain. Since the exclusion ($500,000) exceeds their gain ($420,000) they will not pay any tax on their gains.
As mentioned above, there are cases where certain circumstances may change the tax result. Most of these cases relate to not meeting the requirements to be eligible to take the personal residence gain exclusion. I will focus on two of those cases here.
Rental Properties: If you intend to sell a home that was exclusively used for rental purposes, you will not be able to exclude any portion of the gain.
But what if that property was lived in by the taxpayer for 2 of the last 5 years, and was used for rental purposes intermittently? You should be able to take the gain exclusion, but you may also be subject to depreciation recapture, which would impact your gain calculation. Complications may arise where taxpayer’s have a separate living area used for rental, and thus doesn’t meet the “Use Test”, in which the exclusion would not cover the gains related to that part of the home.
Depreciation Recapture: In cases where the home was previously used for business, for rental, or for home office deductions, there is often depreciation recapture that will affect the gain calculations.
The IRS allows taxpayers to take depreciation deductions for use of property over time so that taxpayers can receive some benefit from owning and using their property for business purposes. However, when it comes time to selling that property, if there is a calculated gain, the IRS will “recapture” that depreciation and tax it at different rates than capital gains. These gains are not excluded under the personal residence exclusion; they are a separate tax requirement and will lead to additional tax separately from the sale of the home.
Most homeowners will not owe federal capital gains tax on every dollar of profit from selling a primary residence. However, your sale involves a large gain, rental history, business use, or an unusual ownership situation, get the tax answer before the closing papers are signed.
Do I have to pay taxes when I sell my home?
Maybe. If the home was your primary residence and you meet the ownership and use tests, part or all of the gain may be excluded from federal income tax. If the gain is larger than the exclusion or special facts apply, some tax may still be due.
How much gain can I exclude when I sell my primary residence?
Under current federal rules, qualifying taxpayers may be able to exclude up to $250,000 of gain, or up to $500,000 for certain married couples filing jointly. The exclusion is based on gain, not gross sale proceeds.
What records should I keep after selling my home?
Keep purchase and sale closing statements, improvement records, dates of residence, and any records related to rental use, home office use, or depreciation. These documents help support the gain calculation and the exclusion position.
Does rental use change the tax result?
It can. Rental use may affect eligibility for the exclusion and may create depreciation recapture. That part of the analysis should be reviewed before the sale is reported.