Last Updated:April 2026
For most Americans, the family home is their largest asset β and the Section 121 capital gains exclusion is one of the most valuable tax provisions in the entire tax code. A married couple who bought their home for $300,000 and sell it for $800,000 can exclude the entire $500,000 gain from federal income tax β paying $0 in federal capital gains on a $500,000 profit. But the exclusion has specific requirements, and several factors can reduce it or eliminate it: short ownership periods, business use, prior depreciation deductions, and high-value gains above the exclusion limit. This guide covers every aspect of the home sale tax calculation β from the basic exclusion to partial exclusions, depreciation recapture, and state tax considerations.
Planning the timing and structure of a home sale can significantly impact the tax outcome, particularly for homes with large appreciated values.
The 2-year use test runs back from the date of sale. If you need to sell but have not yet hit 2 years of use, consider delaying the sale until you cross the 2-year mark. The difference between selling at 23 months vs 25 months of primary residence use can be the difference between paying full capital gains tax and paying $0. Example: you bought a condo in January 2024 and have been living in it. Planning to sell in late 2025? Waiting until January 2026 (24+ months) to list ensures you qualify. The date of closing (not listing) is what counts for the use test.
If you move out and rent the home before selling, the clock on the 5-year lookback window continues. You have up to 3 years after moving out to sell while still counting your prior occupancy toward the 2-year use test. Example: you lived in the home for 2 years, then rented it for 2 years, then sold. You still qualify for the full exclusion (2 years of use within the 5-year window). Wait too long after moving out (more than 3 years), and you lose the benefit for any years prior to the rental period exceeding the 5-year lookback.
For married couples to claim the $500,000 exclusion, both spouses must meet the 2-year use test (lived in the home 2 of last 5 years). Only one spouse needs to meet the ownership test. Practical issue: if one spouse moved into the home shortly before marriage and the couple sells quickly after marriage, the recently-joined spouse may not meet the 2-year use test. In that case, the maximum exclusion is $250,000 (based on the qualifying spouse only). Solution: wait until both spouses have met the 2-year use test before selling if maximising the exclusion to $500,000 is a priority.
If you inherit a home, the basis steps up to fair market value at the date of death. If you move in and use it as your primary residence for 2 years, you can then sell and claim the Section 121 exclusion on any gain above the stepped-up basis. Note: if you sell immediately after inheriting without moving in, the Section 121 exclusion does not apply (you did not meet the use test) β but there will likely be minimal or no capital gain since the basis was just stepped up to FMV.
The Section 121 exclusion applies only to your principal residence. Vacation homes, rental properties, and investment real estate do not qualify. The alternative for investment properties is the 1031 Like-Kind Exchange.
A principal residence is the place where you primarily live β not a vacation home, investment property, or rental. If you own multiple properties, you can only have one principal residence at a time. The IRS looks at: where you spend the most time; where your mail goes; where you are registered to vote; where your car is registered; where your doctors and employers are. You can convert a rental property into your principal residence (move in), but depreciation recapture still applies to the period it was used as a rental, and partial exclusion rules apply if you haven't met the full 2-year use test on the residential use.
If you sell an investment property, a 1031 exchange allows you to defer all capital gains taxes by reinvesting the proceeds into a new 'like-kind' investment property. Rules: you must identify replacement property within 45 days of sale; close on the replacement property within 180 days; the replacement property's value must be equal to or greater than the relinquished property; proceeds must be held by a qualified intermediary. 1031 exchanges defer but do not eliminate capital gains β they carry forward to the eventual taxable sale. For investors with large gains on a rental property, a 1031 exchange is typically far more powerful than any other tax planning tool.
CountryTaxCalc.com is reader-supported. When you use our partner links, we may earn a commission at no cost to you. Learn more about our affiliate partnerships
β 4.8 verified reviews Β· 3,758 reviews
Home sales with large gains, depreciation recapture, partial exclusion situations, or state tax complications require a CPA review before you close. TaxHub connects you with real estate tax specialists.
β Not for simple single-state returns. Free filing is fine for straightforward W-2 situations.
Get Home Sale Tax Planning Help βYou do not need to report the sale on Form 1040 if all three conditions are met: (1) your gain does not exceed the applicable exclusion ($250K single / $500K married); (2) you meet the ownership and use tests; and (3) you did not use the exclusion on another home sale in the prior 2 years. However, if you received Form 1099-S from the closing agent, the IRS has a record of the sale and you should report it (using Schedule D showing the exclusion) to avoid an automated inquiry. If any part of the gain is taxable, you must report the full sale on Schedule D regardless.
Under the current IRS rules, claiming a home office deduction using the simplified method (a standard rate per square foot, up to $1,500/year) does not affect the Section 121 exclusion β you can still exclude the full gain on the entire home. If you used the actual expense method and claimed depreciation on the home office portion of your home, the depreciation claimed is subject to recapture as ordinary income (unrecaptured Section 1250 gain) even if the gain on the residence portion is fully excluded. Practically: if you have been deducting depreciation on a home office for several years, calculate the total depreciation claimed before selling β that amount will be taxed at up to 25% regardless of the exclusion.
If you sell before meeting the 2-year ownership and use tests, no Section 121 exclusion applies unless you qualify for the partial exclusion due to a qualifying reason (job change, health, unforeseen circumstances). The full gain is taxable. If held under 1 year: taxed at short-term capital gains rates (ordinary income rates, up to 37% federal). If held 1β2 years: taxed at long-term capital gains rates (0/15/20%) if you qualify for long-term treatment (1 year + 1 day minimum). The difference between a 364-day and 366-day holding period can mean the difference between 37% and 20% federal tax rates on your gain β plan accordingly if you are approaching the 1-year mark.
A surviving spouse has a 2-year window after the spouse's death to sell the home and claim the full $500,000 married exclusion (not the reduced $250,000 single exclusion) β provided they have not remarried and met the residency requirements with their deceased spouse. This means: if your spouse died in 2024 and you sell the home in 2025 or 2026, you can still exclude up to $500,000 of gain. Waiting until 2027 reduces the exclusion to $250,000 (as a single filer). Additionally, the home receives a step-up in basis at the spouse's death β on the deceased spouse's half of community property (in community property states, the entire property steps up). Surviving spouses should get a CPA involved to optimise the timing of the sale.
State income tax on home sale gains above the Section 121 exclusion is generally unavoidable if you are a resident of that state when the sale closes β regardless of where the property is located. California taxes gains on California real estate even if the seller is a non-resident at the time of sale (California-source income). For a California resident selling their primary home with gains above $500K: no state-level deferral mechanism exists. The only ways to reduce California income tax on the excess gain are: (1) ensure all eligible selling expenses and improvements are included in adjusted basis; (2) consider installment sale if the buyer can pay over multiple years β spreading income across years may keep some gain below the highest California bracket; (3) consult a CPA about California-specific deductions available in the sale year. There is no Section 121-equivalent for California beyond the same federal exclusion amounts.
You should keep records indefinitely for any property you own, because basis documentation may be needed years or decades after purchase. Key documents: original purchase contract and closing disclosure (HUD-1 or Closing Disclosure form); all receipts, invoices, and contracts for capital improvements (remodels, additions, new roof, new HVAC, finished basement, landscaping); any casualty loss deductions or insurance reimbursements that reduced your basis; any depreciation worksheets if you rented the property; original title documents. The IRS can audit a home sale return for 3 years normally (or 6 years if there is a significant understatement) β but you should keep records for at least as long as you own the property plus the audit window. Digital copies of receipts stored in cloud storage are accepted documentation.
Yes, provided it meets the IRS definition of a 'residence' β a structure that contains sleeping space and cooking and toilet facilities. The Section 121 exclusion is not limited to traditional real estate. Mobile homes, houseboats, co-ops, and condominiums all qualify if you owned and used them as your primary residence for 2 of the 5 years before sale. The exclusion does not apply to vacant land you own (even if adjacent to your home). If you sell your home and the land it sits on together, the full proceeds are eligible for the exclusion. Selling the land separately from the home: only the proceeds allocable to the residence qualify for the exclusion β land without a residence does not qualify.