Selling Your Home and the Capital Gains Exclusion (Section 121)
The short answer: Under federal law, a seller can exclude up to $250,000 of gain on the sale of a main home from income, or $500,000 for most married couples filing jointly. To qualify, the seller must have owned the home and used it as their main home for at least 2 of the 5 years before the sale, and generally can't have used the exclusion on another home in the previous 2 years (26 U.S.C. 121; IRS Topic 701).
Sellers ask about this all the time, often at the listing appointment. You won't be giving tax advice, but knowing how the rule works helps you spot when a client should call their tax adviser before setting a closing date. This is general information, not tax advice. For other everyday terms, see our NJ real estate glossary.
What are the ownership, use and look-back tests?
IRS Publication 523 breaks the eligibility test into pieces (IRS Pub. 523):
- Ownership: owned the home for at least 24 months of the 5 years ending on the closing date.
- Residence (use): lived in it as the main home for at least 24 months of those 5 years. The months don't have to be in one block.
- Look-back: didn't take the exclusion on another home sold in the 2 years before this sale.
The ownership and use periods don't have to be the same 24 months, but both must fall inside the 5-year window (IRS Topic 701). A person has only one main home at a time. When someone has two, the IRS looks at where they spend the most time, plus clues like the address on their driver's license, voter registration and tax returns (Pub. 523).
How does the $500,000 joint limit work?
For married couples filing jointly, the limit is $500,000 if either spouse meets the ownership test, both meet the use test, and neither took the exclusion in the prior 2 years (26 U.S.C. 121(b)(2); Topic 701). A surviving spouse who hasn't remarried can still use the $500,000 limit for a sale within 2 years of the spouse's death, if the requirements were met right before the death (121(b)(4); Pub. 523).
How is the gain figured?
Gain is the amount realized minus the adjusted basis (Pub. 523):
- Amount realized is the sale price minus selling expenses. Those include sales commissions, advertising, legal fees and other costs of selling.
- Adjusted basis starts with what the owner paid. It adds the cost of improvements that add value, prolong the home's life or adapt it to new uses.
A made-up example: a couple bought a home for $300,000 and spent $50,000 on an addition. They sell for $700,000 and pay $40,000 in selling expenses. Amount realized is $660,000. Basis is $350,000. Gain is $310,000. If they qualify for the $500,000 joint limit, none of it is taxed. A single owner with the same numbers could exclude $250,000, leaving $60,000 potentially taxable. A loss on a main home can't be deducted (Pub. 523).
What if the seller doesn't meet the 2-year tests?
They may still get a partial exclusion if the main reason for the sale was a change in workplace, health, or an unforeseeable event (26 U.S.C. 121(c)). Publication 523 gives standard examples (Pub. 523):
- Work: a new job at least 50 miles farther from the home than the old work location.
- Health: moving to get or provide care for a family member's illness or injury, or on a doctor's recommendation.
- Unforeseeable events: destruction or condemnation of the home, a disaster casualty, death, divorce or legal separation, multiple births from one pregnancy, becoming eligible for unemployment, or no longer being able to pay basic living expenses after a change in employment.
The partial amount is prorated using Publication 523's worksheet. That's a job for the seller's tax preparer.
What parts of a gain can't be excluded?
A few common situations reduce or block the exclusion:
- Depreciation. Gain equal to depreciation taken after May 6, 1997 (for example, on a home office or a period of renting) can't be excluded (121(d)(6)).
- Nonqualified use. Gain allocated to periods after 2008 when the home wasn't the main residence, such as years as a rental before the owner moved in, generally can't be excluded. Time after the owner moves out, within the 5-year window, doesn't count against them (121(b)(5)).
- Homes acquired in a 1031 exchange. The exclusion doesn't apply if the home is sold within 5 years after it was acquired in a like-kind exchange (121(d)(10)). See our guide to 1031 exchanges.
Why should agents watch the move-out date?
This is where the timing of a listing matters. The 24 months of use have to fall within the 5 years before closing. So a seller who lived in a home for exactly 2 years and then moved out (perhaps renting it) has about 3 years from move-out to close and still pass the use test. That's our arithmetic from the rule (26 U.S.C. 121(a)).
If a seller mentions they moved out a while ago, suggest they check with their tax adviser before you set a closing date. Military, Foreign Service and intelligence community members on qualified extended duty can elect to suspend the 5-year period for up to 10 years (Topic 701).
Does the sale still get reported?
Often, yes. If the seller receives Form 1099-S, Proceeds From Real Estate Transactions, they must report the sale even if all the gain is excludable. They must also report it if any gain is taxable (Topic 701). New Jersey's own income tax treatment and the state forms filed at closing are separate questions for the seller's tax professional and closing attorney. Our closing cost vocabulary guide covers other charges on the settlement statement, and our property tax explainer covers the tax buyers ask about most.
Concepts like this come up in the NJ pre-licensing course and in client conversations. Business Elementary's 75-hour pre-licensing course is where NJ agents start building that foundation.
Sources
- 26 U.S.C. 121, Exclusion of gain from sale of principal residence (LII): https://www.law.cornell.edu/uscode/text/26/121
- IRS, Publication 523 (2025), Selling Your Home (page reviewed Apr. 30, 2026): https://www.irs.gov/publications/p523
- IRS, Topic no. 701, Sale of your home (updated Oct. 12, 2026): https://www.irs.gov/taxtopics/tc701
Last reviewed: October 31, 2026
Frequently Asked Questions
Do I have to buy another home to avoid tax on my home sale?
No. The exclusion doesn't depend on buying a replacement home. It depends on meeting the ownership, use and look-back tests (IRS Topic 701; Pub. 523).
Do the 2 years have to be continuous?
No. The 24 months of residence can fall anywhere within the 5 years before the sale and don't have to be one block of time (Pub. 523).
Can I use the exclusion more than once?
Yes, but generally not more than once in any 2-year period (26 U.S.C. 121(b)(3); Pub. 523).
Does the exclusion apply to condos and co-ops?
Yes. Publication 523 says a single-family home, condominium, cooperative apartment, mobile home or houseboat can each be a main home (Pub. 523).
Are real estate commissions part of the calculation?
Yes. Sales commissions are selling expenses that reduce the amount realized, which reduces the gain (Pub. 523).