Capital gains on residence are profits from selling your primary home that exceed its adjusted basis, subject to federal tax rules under Internal Revenue Code Section 121. The IRS allows up to $250,000 in exclusion for single filers and $500,000 for married couples filing jointly, provided ownership and use requirements are met.
When you sell a home, the difference between the sale price and your adjusted basis determines your capital gain. Adjusted basis includes the original purchase price plus improvements and minus depreciation if applicable. For most homeowners, this figure is calculated as cost basis plus capital improvements such as a new roof or kitchen remodel. The IRS defines capital gains on residence under Section 121, which sets limits on taxable gains based on how long you lived in and owned the home.
For example, if you bought a house for $300,000, spent $40,000 on a deck and HVAC upgrade, and sold it for $650,000, your adjusted basis is $340,000. Your gain is $310,000 ($650,000 - $340,000). If you're a single filer who lived in the home for at least two of the past five years, you can exclude up to $250,000 of that gain from taxable income. The remaining $60,000 may be taxable unless other exclusions apply.
The IRS calculates capital gains on residence using the formula: (Sale Price - Adjusted Basis) = Capital Gain. Adjusted basis includes the original purchase price, closing costs, and capital improvements. Depreciation deductions from prior rental use reduce basis if the home was previously rented.
Homeowners must meet both ownership and use tests to qualify for the exclusion. Ownership requires you have owned the home for at least two years during the five-year period ending on the sale date. Use requires you have lived in the home as your principal residence for at least two of those five years. These periods do not need to be consecutive.
If you sell due to a job relocation, health reasons, or unforeseen circumstances, the IRS allows partial exclusions even if you don't meet the full two-year use requirement. For example, if you moved for a job transfer and stayed in the home for only 18 months, you may still exclude a portion of the gain based on the time you lived there. The IRS provides Form 8822-B for reporting changes in address and qualifying events.
Not all properties qualify for capital gains on residence treatment. Only your primary residence-where you live most of the year-meets the criteria. Second homes, vacation properties, and investment rentals do not qualify for the exclusion unless they were used as a principal residence for part of the ownership period.
| Property Type | Qualifies for Exclusion? | Conditions |
|---|---|---|
| Primary residence | Yes | Owned and used for at least 2 years in last 5 |
| Second home | No | Not eligible unless converted to primary residence |
| Investment rental | No | Capital gains taxed at higher rates if held over 12 months |
| Home used as business office | Partial | Only the portion used for business is excluded |
A common misconception is that you can "reset" the clock by selling and buying another home. The IRS does not allow rolling over the exclusion to a new property. If you sell your home and buy a different one, the gain on the first sale is still subject to tax unless the exclusion applies.
Many people assume that all home sale profits are tax-free. This is false. While the IRS excludes up to $250,000 or $500,000 depending on filing status, gains beyond that amount are taxable. The exclusion applies only once every two years, meaning you cannot claim it twice in a short span.
Another error is failing to report the sale on Form 8949 and Schedule D. Even if the gain is fully excluded, you must file these forms to document the transaction. The IRS cross-references Form 1099-S issued by settlement agents with your tax return. Missing this step increases audit risk.
One non-obvious rule: if you sell a home and move into a rental unit, then later sell that rental, the capital gains on the rental are not covered by the primary residence exclusion. The IRS treats each property separately. A homeowner who sells a primary residence and uses the proceeds to buy a rental property must track the basis and holding period for future sales.
Sarah bought her home in 2016 for $320,000. She paid $15,000 in closing costs and spent $35,000 on a bathroom renovation and central air installation. Her adjusted basis is $370,000. In 2023, she sold the home for $720,000. Her capital gain is $350,000 ($720,000 - $370,000).
Sarah is single and lived in the home continuously from 2016 to 2023. She meets both the ownership and use tests. She qualifies for the $250,000 exclusion. The remaining $100,000 is taxable as long-term capital gain. The tax rate depends on her income level-15% for most middle-income earners.
Had Sarah sold the home in 2021 while still living there, she would have had to report the gain and claim the exclusion. But if she had sold in 2018 and moved abroad, she would not have qualified because she didn't meet the two-year use test. The IRS requires proof of residency through utility bills, voter registration, and tax filings.
Capital gains on residence are governed by IRS Publication 523, which outlines the rules for excluding gain on the sale of a home. The IRS states that "if you meet the ownership and use tests, you can exclude up to $250,000 of gain on the sale of your home." This publication is available at IRS.gov/publications/p523.
Always consult a tax professional before selling. The IRS treats each transaction individually. Missteps in documentation or timing can result in unexpected tax liabilities. Keep records of purchase price, improvements, closing costs, and dates of occupancy.