What if I have to move before I've lived there long enough?
You may still get a partial exclusion if the main reason for the sale was a change in the location of your job, your health, or an unforeseen event. The cap is shrunk to match how long you actually lived there.
Sources
How is the partial exclusion figured?
Take the shortest of three periods: how long you owned the home, how long you lived in it (both in the last 5 years), or how long since your last excluded sale. Divide that by 24 months (or 730 days) and multiply by the full cap.
Sources
What's the distance rule for a job change?
If your new job is at least 50 miles farther from the home than your old job was (or at least 50 miles from the home if you had no job), the IRS treats the sale as work-related without asking why you moved. It's a safe harbor, not the only way: a closer job can still count if the job was the main reason for the sale. This isn't the old moving-expense deduction. That deduction has been suspended for most people for tax years after 2,017, and Congress made the suspension permanent in 2025 (military members and, new in 2025, intelligence community employees are the exceptions). It has no effect on this rule either way.
Sources
What counts as a health reason?
Moving to get, give or make easier medical care or treatment for a disease, illness or injury. That can be for you or a family member. A doctor's recommendation to move to treat or ease an illness or injury is a safe harbor. A move that's merely good for your general well-being doesn't count.
Sources
What counts as an unforeseen circumstance?
The rules list events that count automatically: your home being destroyed or condemned, a disaster damaging it, a death, a divorce or legal separation, having twins or more, losing a job so you qualify for unemployment, or a change in work that leaves you unable to afford basic costs. Other surprises can count too, but wanting a nicer home or earning more money never does. If your situation isn't on the list, the unexpected event has to be the main reason you sold, judged on all the facts. Things that help: the sale came soon after the event, you couldn't have seen it coming, and the home stopped working for you or became hard to afford.
Sources
Authority, strongest first
- Regulation Treas. Reg. § 1.121-3
- Notice Notice 2002-60
Reg. 1.121-3(e)(1)-(3). The Commissioner may designate other events in published guidance; Notice 2002-60 did so for taxpayers affected by September 11, 2001. Examples 7, 8 and 10 show that an improvement in financial circumstances disqualifies even an unforeseen event. For events off the list, Reg. 1.121-3(b) lists six factors (proximity in time, a material change in suitability, impaired ability to maintain the property, use of the property as the taxpayer's residence, reasonable foreseeability and timing within the ownership period).
How is the gain above the cap taxed?
It's long-term capital gain if you owned the home more than 12 months, taxed at 0%, 15% or 20% depending on your income. The part that comes from depreciation is taxed at up to 25%. Taxable gain can raise what you owe for the year, so ask whether more withholding or an estimated payment makes sense to avoid an underpayment penalty.
Sources
Does the net investment income tax apply?
Not to gain you exclude, because the 3.8% tax only counts gain that's included in taxable income. It can apply to gain above the cap if your income is over $200,000 (single) or $250,000 (joint).
Sources
Why would anyone choose not to use the exclusion?
If you expect to sell another home within 2 years at a much bigger gain, you might save the exclusion for that sale. You make the choice by reporting the gain, and you can change your mind within 3 years of the due date of the return.
Sources