Home Blog Section 121 Home Sale Exclusion: The $250K/$500K Rule and Bay Area Traps
Single-family home with for sale sign in a Bay Area neighborhood, illustrating Section 121 principal residence exclusion
Individual Tax

Section 121 Home Sale Exclusion: The $250K/$500K Rule and Bay Area Traps

The short answer

Section 121 excludes $250K/$500K of home sale gain. Bay Area CPA on partial exclusions, the rental conversion trap, and depreciation recapture.

If you bought a Cupertino three-bedroom in 2014 for $850,000 and you're listing it this summer at $1.9 million, your gain on paper is over a million dollars. Without any planning, you'd owe federal long-term capital gains tax of 20%, the 3.8% Net Investment Income Tax, and California state tax up to 13.3% on that gain. That's a tax bill north of $370,000 on the sale of your home.

Internal Revenue Code Section 121 is the rule that prevents that outcome for most homeowners. It lets a single filer exclude up to $250,000 of gain from the sale of a principal residence, and married couples filing jointly exclude up to $500,000. Use the exclusion once every two years, meet the ownership and use tests, and a huge slice of your equity walks out the door federally tax-free.

The headline numbers haven't changed since 1997, which is the problem. The exclusion was generous when the median Bay Area home was $300,000. It is partial relief when the median sale is approaching $2 million. The mechanics of §121, the partial-exclusion safety valves, and the rental-conversion trap that wipes out big chunks of the benefit are all worth knowing before you sign a listing agreement.

The Headline Rule

Section 121 excludes capital gain from the sale of your principal residence up to the cap:

  • $250,000 for single filers, head of household, and married filing separately.
  • $500,000 for married couples filing jointly, provided at least one spouse meets the ownership test and both spouses meet the use test. A surviving spouse can use the $500,000 cap on a sale within two years of the deceased spouse's death under §121(b)(2), provided the joint-filing requirements would have been met immediately before death.

To qualify for the full exclusion, you must have:

  1. Owned the home for at least two of the last five years ending on the date of sale, and
  2. Used the home as your principal residence for at least two of the last five years ending on the date of sale, and
  3. Not used the §121 exclusion on another home sale in the two years before this sale.

The two years of ownership and the two years of use do not have to overlap. You can own a home for two years as a rental, move in for two years as your primary residence, and qualify (subject to the non-qualifying use rules below). The five-year lookback is fixed; the two-year ownership and two-year use windows simply have to fall inside it. IRS Publication 523 is the authoritative reference and walks through every variant.

One detail people miss: the title insurance company will issue a Form 1099-S at closing reporting the gross sale price to the IRS, regardless of whether your gain is excludable. If you're claiming the full exclusion and the sale price is under $250,000 (single) or $500,000 (MFJ), the closing agent may skip the 1099-S, but in the Bay Area that almost never applies. Plan to report the sale on Form 8949 and Schedule D even when no federal tax is owed.

Why Bay Area Sellers Care

The exclusion math is decisive. Median single-family sale prices in 2026 across the Valley:

  • Palo Alto: roughly $3.6 million
  • Cupertino: roughly $2.5 million
  • Mountain View: roughly $2.4 million
  • Sunnyvale: roughly $2.3 million
  • San Jose: roughly $1.5 million

If you bought a decade ago for $700,000 to $1 million and you're selling for $1.5 million to $2 million, your realized gain is commonly $500,000 to $1 million. A married couple checks the boxes, files jointly, and shelters the first $500,000 of gain. On a clean transaction, that's roughly $119,000 of federal tax saved (20% LTCG + 3.8% NIIT on the excluded $500,000), plus the California portion of that excluded slice (California conforms to §121).

If your gain exceeds the cap, the excess is taxed at ordinary long-term capital gains rates. Federal: 0%, 15%, or 20% depending on total taxable income, plus 3.8% NIIT once modified AGI clears $250,000 MFJ. California: ordinary income rates up to 13.3% with no special LTCG treatment. Property location matters as much as anything: our Palo Alto tax accountant and Mountain View tax accountant pages exist because the local price points push more sellers above the §121 ceiling.

The 2-of-5 Test in Practice

The ownership and use tests are independent. They each ask, separately, whether you owned the home for 24 cumulative months during the 60-month period ending at sale, and whether you used the home as your principal residence for 24 cumulative months during that same period.

"Cumulative" matters. You can leave the property for six months on a sabbatical, come back, leave again, and still meet the use test as long as the total months of use as principal residence add up to 24. The IRS looks at the totality of facts: voter registration, mailing address, driver's license, where your kids attend school, where you keep your possessions, and where your bank accounts are anchored. One home, one principal residence at a time.

Vacation homes and second homes that never became your principal residence do not qualify for §121, full stop. You don't get an exclusion on the cabin in Tahoe unless you actually moved in for two years.

Special use cases that count

  • Service members. The five-year lookback can be suspended for up to 10 years during qualified extended duty. A returning veteran can therefore meet the use test on a home they haven't lived in for years.
  • Divorce. A spouse who receives the home under a divorce instrument tacks on the other spouse's ownership and use period. Use by either spouse counts.
  • Surviving spouses. A widow or widower can use the $500,000 MFJ cap on a sale within two years of the deceased spouse's death, provided the home would have qualified for the joint exclusion immediately before death.
  • Death of either spouse mid-year. A final joint return can claim the $500,000 cap if both met the use test before death and the survivor satisfied ownership.

The Partial Exclusion (§121(c))

You don't always have to hit the full two-year hurdles. IRC §121(c) provides a partial exclusion when you sell before reaching two years of ownership or use, but only if the early sale was driven by one of three statutory reasons:

  1. Change in place of employment. The new job (yours, your spouse's, or a co-owner's) must be at least 50 miles farther from the old home than your previous job was. A switch from Apple Park to a new role in Austin clears the bar by a thousand miles; a switch within the same Cupertino office probably does not.
  2. Health. Move recommended by a physician for the diagnosis, cure, mitigation, or treatment of disease, or to provide care for a family member. Documentation matters; get the recommendation in writing.
  3. Unforeseen circumstances. A specific safe-harbor list in the regulations covers death, divorce or legal separation, multiple births from the same pregnancy, eligibility for unemployment, change in employment that leaves you unable to pay basic living expenses, condemnation of the property, casualty loss, and a few others. The IRS has discretion to recognize additional facts as "unforeseen," but unlisted reasons are litigated more often than they win.

The partial exclusion is pro-rata based on time of qualified ownership or use. The shorter of (months of qualifying ownership / 24) or (months of qualifying use / 24) multiplied by the full cap gives the available exclusion.

Example. A married couple sells their San Jose home after 18 months because one spouse accepted a job in Seattle (well over 50 miles farther). Available exclusion: (18 / 24) × $500,000 = $375,000. If their gain is $400,000, they pay tax on only $25,000 of it.

The Non-Qualifying Use Trap (§121(b)(5))

This is the rule that most sellers don't know about, and the one our team most often catches at filing. Added by the Housing Assistance Tax Act of 2008 and effective for sales after December 31, 2008, §121(b)(5) carves out gain attributable to periods of non-qualifying use after January 1, 2009 from the §121 exclusion entirely.

"Non-qualifying use" means any period the home was not used as a principal residence by the taxpayer, the spouse, or a former spouse. A rental period before the property became your residence is non-qualifying. A use as a vacation home before conversion is non-qualifying. Time the property sat as a pure investment with you never living in it is non-qualifying.

The exclusion is reduced by the fraction of total ownership time that was non-qualifying:

Gain not excludable = Total gain × (Non-qualifying use period after 1/1/2009 / Total ownership period)

The portion of gain that maps to non-qualifying use is taxable LTCG. The remainder is run through the normal §121 cap and excluded up to $250K/$500K.

Two important exclusions from the non-qualifying-use definition:

  • Pre-2009 periods don't count. Time the home was a rental before January 1, 2009 is treated as qualifying use for §121(b)(5) purposes.
  • Post-conversion periods don't count. Time the home was a rental after it stopped being your principal residence (e.g., you moved out and rented it before selling) is not non-qualifying use, provided the sale happens within the five-year lookback. The IRS calls this the "post-use rental" exception, and it's the reason savvy sellers can briefly rent before listing without losing the exclusion.

The Rental-to-Primary Conversion Sequence

Here is where families get burned. The scenario:

  • 2020: You buy a Sunnyvale duplex as a pure rental for $1.2 million. Tenants occupy both units.
  • 2024: You move into one unit, convert the property to your principal residence, and live there.
  • 2027: You sell for $2.0 million. Total gain: $800,000.

Total ownership: 7 years (2020 to 2027). Qualifying use (as primary): 3 years (2024 to 2027). Non-qualifying use: 4 years (2020 to 2024). All non-qualifying years are after 1/1/2009, so they all count against you.

Non-qualifying-use ratio = 4 / 7 = 57.1%

Gain allocated to non-qualifying use = $800,000 × 57.1% = $457,143. This portion is fully taxable LTCG, no §121 shelter.

Gain available for §121 exclusion = $800,000 minus $457,143 = $342,857. If you file MFJ, that's under the $500,000 cap so the entire remainder is excluded. Total taxable gain: $457,143 instead of $300,000 (which is what you'd have owed if you mistakenly claimed the full $500,000 exclusion).

And then there's depreciation recapture. Every year you owned the property as a rental, you took (or were required to take) depreciation deductions against your rental income. Section 1250 recapture taxes the cumulative depreciation at a special 25% federal rate, and §121 explicitly does not shelter recaptured depreciation. If you took $80,000 of depreciation over the four rental years, that $80,000 comes back as ordinary-rate gain capped at 25% federal, regardless of your §121 exclusion.

Plan the conversion sequence consciously. The longer you hold as primary relative to total ownership, the more of your gain qualifies. Holding 5 years as primary out of 7 years total (vs. 3 of 7) cuts the non-qualifying ratio from 57% to 29%. The math rewards patience.

The §1031-into-§121 Sequence

Real estate investors sometimes combine a Section 1031 like-kind exchange with a later §121 conversion. The play: 1031 from one rental into a replacement rental, hold the replacement long enough, then move in and convert to a primary residence to layer on the §121 exclusion when you eventually sell.

Section 121(d)(10) regulates this stack. To qualify for the §121 exclusion on property previously acquired in a 1031 exchange, you must own the property for at least five years from the date of the original 1031 acquisition before any sale. And you still get hit with the non-qualifying-use rules for any period after the exchange when the property was held as a rental rather than as your home.

This is high-impact planning for investors with appreciated rentals who want to wind down to a single primary residence. It is also fragile. The five-year clock, the conversion timing, the non-qualifying-use math, and the depreciation recapture all have to line up. Walk through it with a CPA before pulling the trigger, not after.

Three Worked Examples

Example A: Married couple in Palo Alto, full §121 plus excess gain

A married couple bought a Palo Alto home in 2008 for $1.1 million. Sold in 2026 for $3.0 million. Selling costs and improvements added $200,000 to basis. Gain: $3.0M minus ($1.1M + $0.2M) = $1.7 million.

They lived in it the entire time, file MFJ, qualify for the full $500,000 exclusion. Excluded gain: $500,000. Taxable LTCG: $1.2 million. Federal tax at 20% plus 3.8% NIIT = $285,600. California tax on the full $1.2M at marginal rates: roughly $130,000. Total federal + state on the home sale: ~$415,000. Without the §121 exclusion, that bill would have been roughly $173,000 higher.

Example B: Engineer relocates after 14 months, partial exclusion

An engineer buys a Cupertino townhome solo for $1.4 million in March 2025. Accepts a new role in Austin in May 2026 and sells the home that month for $1.65 million. Holding period: 14 months. Move is more than 50 miles farther from the new job, so the employment-change safe harbor applies.

Gain: $250,000 (ignoring closing costs for simplicity). Partial exclusion ratio: 14/24. Available exclusion: 14/24 × $250,000 (single cap) = $145,833. Taxable gain: $104,167. Federal tax treatment: 14 months crosses the 12-month line so this is long-term capital gains. Roughly $20,833 federal plus California state tax.

Without the partial exclusion he would have owed roughly $50,000 federal plus the full state hit. The exclusion saved him about $29,000.

Example C: Duplex conversion with depreciation recapture

A single filer bought a Mountain View duplex in 2018 for $1.5 million and rented both units until 2023. Took $145,000 cumulative depreciation over those five years. In 2023 he converted one unit to his primary residence and rented out the other. In 2027 he sells the entire property for $2.3 million. Gain: $800,000.

Ownership: 9 years (2018-2027). Period one unit was used as principal residence: 4 years (2023-2027). Non-qualifying use period (entirely rental, both units): 5 years (2018-2023), all post-2009. He sells the entire duplex, but only half of it was ever used as principal residence.

This is where the dual-use rules kick in. Under Treas. Reg. §1.121-1(e), basis, depreciation, and gain are allocated between the residential and non-residential portions of a single property; the rental portion does not qualify for §121. (The often-cited §121(d)(6) governs depreciation recapture on property used in a trade or business; the post-TIPRA 2005 allocation framework for multi-unit and mixed-use residences is in §121(b)(3) and Treas. Reg. §1.121-1(e).) Practically: only the residential portion of the gain is potentially eligible for §121. The other half, the still-rental unit, gets no exclusion and faces full LTCG plus depreciation recapture.

The math is gnarly. Half the gain ($400,000) is on a unit that was rental-then-primary; the §121(b)(5) non-qualifying-use fraction is 5/9 = 55.6%, so $222,222 of that $400,000 is non-excludable. The remaining $177,778 falls within the $250,000 single cap and is excluded. The other half ($400,000) on the still-rental unit is fully taxable LTCG. Plus $145,000 in depreciation recapture taxed at the 25% rate regardless of any §121 treatment.

This is exactly the kind of transaction that benefits from a pre-sale planning session. Variables you can still control: selling unit by unit (segregating §121 from the rental), timing the sale relative to the conversion, and harvesting offsetting capital losses in the same year.

12 to 24 months from listing a Bay Area home? We model §121 plus depreciation recapture plus rental-conversion math before you sign the listing agreement. Schedule a complimentary consultation and we will lay out the cleanest path for your specific timeline.

What Goes Wrong Without a CPA

The most common pattern we see at intake: a homeowner converted a Bay Area rental into a primary residence three years before selling, claimed the full $500,000 exclusion on their TurboTax-prepared return, and forgot the §121(b)(5) non-qualifying-use rule. The IRS catches it 18 months later via a CP2000 notice. On a typical $700,000 gain with a 4-of-7-year non-qualifying-use ratio, the under-reported tax bill runs $50,000 to $80,000 federal plus California, plus 20% accuracy-related penalty plus interest. The fix is a §6213 response or amended return, neither of which is cheap.

DIY tax software does not flag rental-to-primary conversion math, does not track Treas. Reg. §1.121-1(e) basis allocations for mixed-use property, and does not recapture depreciation correctly when the property had been rented before conversion. Those are the items where engagement with a CPA pays for itself in a single sale year.

Other Things to Get Right

  • Inherited homes. An inherited home gets a stepped-up basis to fair market value at the decedent's date of death. If you inherit, move in, live there for two years, and sell, your §121 exclusion applies against gain measured from the stepped-up basis. Often this means little to no gain in the first place. See our piece on whether you need a trust for the upstream planning.
  • Home offices. Pre-2002 rules treated the home-office portion as a separate non-residential property requiring basis allocation. Current rules: as long as the office is part of the same dwelling unit and you meet the §121 tests on the residence, the entire gain qualifies for the exclusion. The depreciation recapture rule still applies to office depreciation taken after May 6, 1997.
  • Multi-unit properties. §121 only applies to the unit you actually used as your principal residence. Basis and sale price must be allocated to that unit; the rest follows §1231 / §1250 rental property rules.
  • 1099-S reporting. Always reported regardless of exclusion above the de minimis thresholds. Report on Schedule D / Form 8949 even when zero gain is taxable.
  • California conformity. California conforms to §121 in nearly all respects. The state exclusion is the same $250K / $500K. Conversely, California does NOT conform to §1031 deferral on properties exchanged out of California after 2014 without filing annual FTB Form 3840.

When to Talk to Us

If you're 12 to 24 months away from selling a Bay Area home, the value of getting §121 right is substantial. The exclusion stacks with basis tracking from improvements, with the timing of any rental conversion, with the placement of the sale relative to other capital gains and losses, and with the residency decisions of trailing spouses. A 30-minute conversation in advance routinely saves five-figure tax bills at closing.

At Silicon Valley Tax, we work through home-sale planning for individual filers, investor-converted-to-primary scenarios, and trust-held residences across San Jose, Palo Alto, Mountain View, Sunnyvale, and Cupertino. Our individual tax planning team handles the gain calculation, the depreciation recapture, the partial exclusion documentation, and the California-specific reporting alongside the federal return.

Schedule a complimentary consultation if you're considering listing your home, converting a rental, or wrapping a 1031 exchange. We will walk through your specific timeline, basis tracking, and exclusion math before you sign anything.

Frequently Asked Questions

Can I use §121 if I'm single?

Yes. Single filers, head of household, and married-filing-separately taxpayers get a $250,000 exclusion on a qualifying home sale. The ownership and use tests are the same: 2 of the last 5 years owned and used as principal residence, with no §121 exclusion claimed on another sale in the prior 2 years.

What happens to gain above $500,000 MFJ?

Excess gain is taxed at long-term capital gains rates if you owned the home more than one year. Federal: 0%, 15%, or 20% based on taxable income brackets, plus 3.8% Net Investment Income Tax once modified AGI exceeds the threshold. California taxes the entire excess at ordinary income rates up to 13.3%.

Does an inherited home qualify for §121?

An inherited home does not automatically qualify, but you can qualify by moving in and meeting the ownership and use tests on your own (typically 2 of the next 5 years). Because the home received a stepped-up basis at the decedent's death, gain measured from that new basis is often modest, and §121 can shelter what's left.

Can I claim §121 more than once in my life?

Yes. The rule is once every two years, not once per lifetime. The two-year clock runs from the date of the prior excluded sale. There's no cap on how many times you can use the exclusion across your lifetime as long as you space the sales properly and meet the ownership and use tests on each home.

If I rent out my home for a year before selling, do I lose the exclusion?

Usually not. Post-conversion rental periods (rental after the home was your principal residence) are not treated as non-qualifying use under §121(b)(5), as long as the sale closes within the five-year lookback window so that you still meet the 2-of-5 use test. Pre-conversion rental periods are a different story and are penalized under the non-qualifying-use rule.

Does §121 cover depreciation recapture?

No. Any depreciation taken on the property after May 6, 1997 is recaptured at the 25% federal §1250 rate regardless of §121. The exclusion shelters the appreciation gain, not the recapture. This is why pure home-office depreciation can come back to bite you at sale even when the full gain otherwise qualifies for the exclusion.

Selling a Bay Area home this year?

A pre-sale §121 review costs nothing and routinely saves five figures. Talk to our individual tax team before you sign the listing agreement.