Main Residence: Capital Gains Exclusion and Ownership Tests

Under IRS rules, your main residence is the home where you actually live most of the year, and when you own more than one property the agency decides which qualifies by weighing a cluster of facts about your daily life rather than any single document. The designation matters because selling your main residence lets you exclude up to $250,000 of profit from federal capital gains tax, or $500,000 if you’re married filing jointly.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence For most homeowners that covers the entire gain. Getting the classification right, and knowing the rules that come with it, is what separates a tax-free sale from a surprise bill.

How the IRS Decides Which Home Is Your Main Residence

When you own more than one home, the IRS applies a facts-and-circumstances test. No single factor controls. The strongest indicator is where you physically spend the majority of the year, and everything else is supporting evidence that either lines up with that or contradicts it.

Documents that carry weight include the address on your federal and state tax returns, your driver’s license, your vehicle registration, and your voter registration. Financial ties matter too: where your primary bank accounts sit and the mailing address your financial institutions use. Social anchors round out the picture, including the location of your children’s school, your workplace, and memberships in local organizations.2Internal Revenue Service. Publication 523 – Selling Your Home

The practical implication is coherence. If you claim one home as your principal residence but your license, voter registration, and bank statements point to another, an auditor sees the mismatch. Keep the records aligned with the home you actually treat as your base.

The Capital Gains Exclusion When You Sell

The main tax benefit tied to a principal residence is the Section 121 exclusion. On a profitable sale you can exclude up to $250,000 of gain from taxable income, or $500,000 on a joint return.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Gain is the selling price, minus selling costs like agent commissions, minus your adjusted basis. Adjusted basis is what you paid for the home plus the cost of capital improvements over the years. A new roof, an added bathroom, a replacement HVAC system — all raise your basis and shrink any taxable gain. Routine maintenance and repairs don’t count. Keep records of improvements. They pay off if your gain ever climbs above the exclusion.

You can only use the exclusion once every two years. If you claimed it on another home sale within the two years before your current sale, you can’t claim it again now.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

The Ownership and Use Tests

To qualify for the full exclusion you have to pass two tests. The ownership test asks whether you owned the home for at least two years during the five-year period ending on the sale date. The use test asks whether you lived in it as your principal residence for at least two of those same five years.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence The two periods don’t have to overlap, and neither has to be continuous. You could live in the home a year, rent it out two years, then move back in for another year before selling.

Married Couples Filing Jointly

To claim the full $500,000 exclusion on a joint return, only one spouse needs to meet the ownership test, but both must independently meet the use test. Neither spouse can have used the Section 121 exclusion on another sale in the prior two years.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence If only one spouse meets the use test, the couple is capped at $250,000.

Surviving Spouses

A surviving spouse can still claim the full $500,000 exclusion if the home sells within two years of the other spouse’s death, provided the survivor hasn’t remarried by the sale date, the two-year ownership and use tests are met, and neither spouse claimed the exclusion on another home in the two prior years. The surviving spouse counts the deceased spouse’s time of ownership and use toward the requirements.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence The two-year window is short and easy to miss, but on an appreciated home the extra $250,000 of exclusion is worth planning around.

Selling Before Two Years: The Partial Exclusion

If you sell before meeting the two-year tests, you may still qualify for a partial exclusion. The sale has to be driven by a change in employment, a health reason, or an unforeseen circumstance.3eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements

For employment moves, the IRS offers a distance safe harbor: if your new workplace is at least 50 miles farther from the sold home than your old workplace was, you automatically qualify. With no previous job, the new workplace just needs to be at least 50 miles from the home.4U.S. Department of the Treasury. Treasury Regulation 1.121-3 – Distance Safe Harbor Health-related sales qualify when a doctor recommends a move for the diagnosis, cure, or treatment of you, your spouse, or a qualifying family member.

The IRS also recognizes specific unforeseen events, including condemnation or destruction of the home, disasters, the death of a household member, divorce or legal separation, eligibility for unemployment compensation, an employment change that makes housing costs unaffordable, and multiple births from the same pregnancy.3eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements

The partial exclusion is prorated. Take the shortest of three periods: your time using the home during the five-year lookback, your total time of ownership, or the time since you last claimed a Section 121 exclusion. Divide by 24 months (or 730 days) and multiply by $250,000. Joint filers each run the calculation and add the results.2Internal Revenue Service. Publication 523 – Selling Your Home

Rental Use, Nonqualified Use, and Depreciation

If you used your home for something other than a principal residence during the time you owned it, part of your gain may fall outside the exclusion. The statute calls these stretches “periods of nonqualified use,” meaning any time after December 31, 2008, when the property was not the principal residence of you or your spouse.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Your exclusion is reduced by a fraction: total period of nonqualified use divided by the total period of ownership. Only that fraction of the gain becomes ineligible. If you owned a home ten years, rented it out the first four, then lived in it for six, the fraction is 4/10, and 40% of the gain is taxable.

Three exceptions keep certain absences from counting. Time after the last date you used the home as your principal residence doesn’t count against you. Military service on qualified extended duty is excluded for up to ten years. And temporary absences of up to two years total for employment changes, health, or unforeseen circumstances also don’t count.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence A one-year work assignment out of state, with a return afterward, generally doesn’t shrink the exclusion.

Depreciation Recapture

Any depreciation you claimed during a rental or business-use period gets taxed when you sell. The Section 121 exclusion does not cover it. This “unrecaptured Section 1250 gain” is taxed at a maximum rate of 25%, whether or not the rest of the profit is excluded.5Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed Even if your total gain sits well below the exclusion limit, every dollar of prior depreciation still owes tax. Recapture is reported on Form 4797.6Internal Revenue Service. Instructions for Form 4797

Home Offices Inside the Home

A home office that shares the same dwelling unit as your living space gets favorable treatment. You do not split the gain between business and personal use. The full gain is eligible for the Section 121 exclusion, and you don’t file the business portion separately on Form 4797.2Internal Revenue Service. Publication 523 – Selling Your Home

The catch is depreciation. Any depreciation claimed on the home office after May 6, 1997, must still be recaptured and taxed at up to 25%.7eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence If the office sits in a separate structure, such as a detached guesthouse converted to workspace, different rules apply and the gain has to be allocated between the structures.

Special Situations

Inherited Homes

An inherited home receives a stepped-up basis equal to its fair market value on the date of the decedent’s death.8Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent A home a parent bought for $80,000 that was worth $400,000 at death gives you a starting basis of $400,000. For many inherited homes sold soon after inheritance, taxable gain is modest or zero. If you keep the home for years and it appreciates well above the stepped-up basis, the Section 121 exclusion becomes relevant, but you still have to meet the two-year ownership and use tests, with ownership starting from the transfer date.

Homes Acquired Through a 1031 Exchange

If you acquired the home as replacement property in a like-kind (Section 1031) exchange, you cannot claim the Section 121 exclusion at all during the first five years of ownership. After the five-year mark you still need to satisfy the standard two-year use test.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Selling even a month before the five-year point disqualifies the exclusion entirely.

Military and Foreign Service

Members of the uniformed services, the Foreign Service, and the intelligence community can elect to suspend the five-year lookback for up to ten years while on qualified official extended duty. That stretches the effective window from five years to fifteen.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence You make the election by filing the return for the year of sale and excluding the gain. You can only suspend the clock on one property at a time.9eCFR. 26 CFR 1.121-5 – Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service Time on qualified extended duty also doesn’t count as nonqualified use.

Destroyed or Condemned Homes

When a principal residence is destroyed, condemned, or seized, the event is treated as a sale for Section 121 purposes, with insurance proceeds or the condemnation award as the amount realized. If gain on that deemed sale falls within the exclusion limits, you can exclude it just as on a voluntary sale.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence If you use the proceeds to buy a replacement home under the involuntary conversion rules of Section 1033, ownership and use time from the destroyed property carries over.

Reporting the Sale

Whether you have to report the sale depends on two things: whether the exclusion covers the entire gain, and whether you received a Form 1099-S at closing.

If the gain is fully excluded and no Form 1099-S was issued, you generally don’t need to report the sale at all.2Internal Revenue Service. Publication 523 – Selling Your Home Closing agents aren’t required to issue a 1099-S when the seller certifies that the home is a principal residence and the full gain is excludable — under $250,000 for single filers or under $500,000 for joint filers with no nonqualified-use periods.10Internal Revenue Service. Instructions for Form 1099-S – Proceeds From Real Estate Transactions

If you did receive a 1099-S, report the sale on Form 8949 even when the whole gain is excludable, and show the exclusion as an adjustment. When any gain is taxable — because it exceeds the limit, you have nonqualified use, or you owe depreciation recapture — report it on Form 8949 and summarize on Schedule D of Form 1040.2Internal Revenue Service. Publication 523 – Selling Your Home Depreciation recapture goes on Form 4797.6Internal Revenue Service. Instructions for Form 4797