When you sell your main home, federal law lets you exclude up to $250,000 of profit from income tax if you file singly, or up to $500,000 if you’re married filing jointly. This primary residence tax exclusion, found in Section 121 of the Internal Revenue Code, applies only if you owned and lived in the home for at least two of the five years before the sale.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Anything above your exclusion is taxed as a long-term capital gain, and prior rental or business use of the home can carve into the exclusion in ways that surprise people at filing time.
Who Qualifies: The Ownership and Use Tests
Two tests decide whether you get the full exclusion. You must have owned the home for at least 730 days during the five years ending on the sale date, and you must have lived in it as your main home for at least two years during that same five-year window.2Internal Revenue Service. Publication 523 – Selling Your Home The two years of residence don’t have to be consecutive. A year in, two years out, a year back in still passes. Short absences like vacations count as time in the home.
There is also a look-back rule. You can’t have claimed the Section 121 exclusion on another home sale in the two years before this one.2Internal Revenue Service. Publication 523 – Selling Your Home
For a married couple to claim the $500,000 amount on a joint return, at least one spouse has to meet the ownership test, both spouses have to meet the use test, and neither can have used the exclusion in the prior two years.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence When only one spouse qualifies, the couple can still take the individual $250,000 exclusion.
Selling Before Two Years: Partial Exclusion
Falling short of the two-year requirement doesn’t automatically wipe out your exclusion. A prorated amount is available if the sale was triggered by a job change, a health-related move, or an unforeseeable event.2Internal Revenue Service. Publication 523 – Selling Your Home
A work-related move qualifies when your new workplace is at least 50 miles farther from the home than your old one was, or at least 50 miles from the home if you had no prior job.3eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements Health-related moves qualify when you relocate to get or provide medical care for yourself or a family member, or when a doctor recommends a change in residence. Unforeseeable events named by the IRS include destruction or condemnation of the home, divorce, and job loss.
The math is simple. Take the shortest of three periods: your time owning the home, your time living in it, or the time since you last claimed the exclusion. Divide those days by 730 and multiply by $250,000 (each spouse calculates separately on a joint return).2Internal Revenue Service. Publication 523 – Selling Your Home One year of qualifying ownership and use produces a reduced exclusion of roughly $125,000 for a single filer.
Surviving Spouses
A widow or widower who sells within two years of the spouse’s death can still claim the full $500,000, provided the couple would have met the joint-return requirements just before the death.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Past that two-year mark, the exclusion drops to the $250,000 single-filer amount.
Military, Foreign Service, and Intelligence Personnel
Service members and certain federal personnel can elect to suspend the five-year lookback for up to 10 years while on qualified extended duty, stretching the effective window to as long as 15 years.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence A service member who lived in the home for two years before deploying can sell years later and still qualify. The election applies to the service member or spouse.
Figuring the Gain
Your gain isn’t just the sale price minus the purchase price. Start with what you paid, add capital improvements, and that’s your adjusted basis. Then subtract selling expenses from the sale price to get your amount realized. Gain is the difference between the two.
Capital improvements are permanent upgrades: a new roof, a kitchen renovation, a finished basement, central air. Repairs and maintenance don’t count. Save receipts and contracts; if the IRS challenges your basis, you’ll need them.
One catch that trips up recent renovators: if you claimed a federal energy efficiency credit for an improvement, you have to reduce your basis by the credit amount.4Internal Revenue Service. Instructions for Form 5695 – Residential Energy Credits A $2,000 solar credit means the panels add their cost minus $2,000 to your basis, not the full price.
Selling expenses that reduce your amount realized include real estate commissions, attorney fees for deed preparation, and transfer taxes. If the resulting gain is under your exclusion limit, no federal capital gains tax is due.
When the Exclusion Doesn’t Cover the Full Gain
Two rules can pull income out of the exclusion even if you otherwise qualify. Both come up when the home was used for something other than personal residence at some point.
Depreciation Recapture
Any depreciation you deducted for a home office or rental portion after May 6, 1997, cannot be excluded. That amount is treated as unrecaptured Section 1250 gain and taxed at up to 25%, no matter how much exclusion you have left.5Internal Revenue Service. Sales, Trades, Exchanges 36Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed The rule reaches depreciation “allowed or allowable,” so even skipping the deduction doesn’t help unless you can prove through records what you actually claimed.
Non-Qualified Use After 2008
If the home had periods after 2008 when neither spouse used it as a primary residence, the gain attributable to that non-qualified use is not excludable.2Internal Revenue Service. Publication 523 – Selling Your Home The IRS divides non-qualified days by total ownership days and applies that fraction to your gain.
Not every absence counts. The period after you last used the home as your main residence is exempt, so renting it in the final stretch before sale won’t trigger the rule. Military service suspensions of up to 10 years and temporary work, health, or unforeseen absences of up to two years are also exempt.2Internal Revenue Service. Publication 523 – Selling Your Home Converting a former rental to a primary residence, living in it two years, then selling still passes the use test but leaves the rental-era gain taxable.
Rates on Gain Above the Exclusion
Gain above the excluded amount is a long-term capital gain if you owned the home more than a year. Federal rates are 0%, 15%, or 20% depending on taxable income.6Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed For 2026, single filers pay 0% below $49,450 of taxable income, 15% in the middle range, and 20% above $545,500. Joint filers hit the 15% bracket at $98,900 and the 20% rate above $613,700.
Higher earners can also owe the 3.8% Net Investment Income Tax when modified adjusted gross income exceeds $200,000 (single) or $250,000 (joint). The surtax applies to the lesser of net investment income or the amount MAGI exceeds the threshold.7Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax Those thresholds are not indexed for inflation.
Depreciation recapture is calculated first and taxed at up to 25%; the remaining gain then flows through the capital gains brackets.
h2>Reporting the Sale
If your entire gain is excludable and you did not receive a Form 1099-S at closing, you don’t have to report the sale on your return.8Internal Revenue Service. Important Tax Reminders for People Selling a Home The closing agent can skip issuing a 1099-S if you sign a certification, under penalty of perjury, that the home was your principal residence, the full gain is excludable, and there were no non-qualified use periods after 2008.9Internal Revenue Service. Instructions for Form 1099-S Some agents ask for the certification automatically; others don’t. Bring it up if they don’t.
You do have to report if your gain exceeds the exclusion, you received a 1099-S, you have depreciation to recapture, or you don’t qualify for the full exclusion. Use Form 8949 to list the transaction with purchase and sale dates, proceeds, and adjusted basis.10Internal Revenue Service. Form 8949 – Sales and Other Dispositions of Capital Assets The totals carry over to Schedule D on Form 1040.
Keeping Records
The IRS can generally assess additional tax within three years of your filing date. That window extends to six years if you underreported income by more than 25%, and there’s no limit for a fraudulent return or one that was never filed.11Internal Revenue Service. Time IRS Can Assess Tax Practical advice: hold on to purchase documents, improvement receipts, and closing paperwork well beyond three years. If the IRS questions your basis and you’ve shredded the renovation invoices, you lose the higher basis that reduces the taxable gain. Digital copies stored in the cloud are the simplest way to keep everything intact between a remodel and a sale that could be decades apart.