Capital Gains Tax on a Home Sale in California
By Matthew Martinez, Founder, CEO & Managing Broker, Diamond Real Estate Group. California DRE #01869679.
When you sell your main home in California, federal law lets you exclude up to $250,000 of gain from income, or $500,000 on a joint return, if you owned the home and lived in it for at least two of the five years before the sale. California applies the same exclusion through its own tax code. Any gain above it is taxable by both governments, and California taxes it at the same rates as wages, because the state has no lower rate for capital gains.
That last point matters most to long-time owners in Sonoma, Napa, Marin and San Francisco, where a home bought decades ago can carry a gain far larger than the exclusion. This guide explains the tests, how gain is figured, the situations that shrink or expand the exclusion, and how the sale shows up in escrow and on your returns. It is part of our guide to the California selling process.
The section 121 exclusion in plain terms
The rule is Internal Revenue Code section 121, and the IRS explains it in Publication 523, Selling Your Home (2025 edition, for 2025 returns). There are three tests, all measured over the five years ending on the sale date.
| Test | What it requires | Joint filers seeking $500,000 |
|---|---|---|
| Ownership | You owned the home for at least 24 months of the five years | Only one spouse has to meet it |
| Residence | You lived in it as your main home for at least 24 months (730 days); the time doesn’t need to be continuous | Each spouse must meet it |
| Look-back | You haven’t excluded gain on another home sale in the two years before this one | Each spouse must meet it |
If a married couple doesn’t qualify for the full $500,000, Publication 523 says each spouse can be tested as if single. Two disqualifiers apply even when the tests are met: a home acquired through a 1031 like-kind exchange within the past five years, and a seller subject to the expatriate tax.
There is no separate age-based exclusion in today’s section 121. Sellers in their 60s and 70s use the same tests as everyone else. One provision helps older owners, though: if you become unable to care for yourself, time in a licensed care facility can count as residence, as long as you lived in the home for at least one year of the five.
How the gain is figured
Gain is the amount you realize from the sale minus your adjusted basis. The amount realized is the sale price less selling costs, such as commissions. Your adjusted basis starts with what you paid, plus certain purchase costs, plus the cost of improvements.
- Counts toward basis: improvements that add value, extend the home’s life or adapt it to a new use. Publication 523 gives additions, a new roof, central air conditioning and a kitchen modernization as examples. Recording fees and owner’s title insurance from your purchase also count.
- Doesn’t count: routine repairs and upkeep, such as painting or fixing a leak, unless done as part of a larger remodel. Items that are no longer part of the home, or that last less than a year, don’t count either.
- Reduces basis: energy credits or subsidies you received for improvements, and depreciation you took or could have taken on any business or rental use.
Basis records are often the weak spot for owners who have held a house for twenty years. Before you list, pull the closing statement from your purchase, permits and invoices for major work, and any prior returns that claimed a home office.
A hypothetical example
A married couple bought a Petaluma house in 2004 for $520,000 and paid $10,000 of qualifying purchase costs. Over the years they added a bedroom and replaced the roof for $120,000, so their basis is $650,000. They sell in 2026 for $1,650,000 and pay $90,000 in selling costs, for an amount realized of $1,560,000.
Their gain is $910,000. After the $500,000 exclusion, $410,000 is taxable on their federal return and again on their California return. The numbers are illustrative only; your own figures should come from your records and your tax adviser.
How California taxes what’s left
California adopts section 121 in Revenue and Taxation Code section 17152, with a few modifications. Peace Corps service can reduce the two-year ownership and use period by up to 18 months. And a taxpayer who is barred from filing a joint California return, but files a joint federal return for the same year, is treated as meeting the joint-return conditions for the larger exclusion.
Federal elections carry over. If you elect out of section 121 or suspend the five-year period on your federal return, California follows that election, and you can’t make a different one for the state.
On the taxable part, the Franchise Tax Board’s guidance leaves no room for doubt: “California does not have a lower rate for capital gains. All capital gains are taxed as ordinary income.” A large gain can therefore push a seller into California’s upper brackets for that year. Federally, the taxable gain is a capital gain, and the 3.8% net investment income tax can apply to it when modified adjusted gross income exceeds $250,000 on a joint return or $200,000 for a single filer. The IRS says the excluded portion of a home sale gain isn’t subject to that tax.
Partial exclusions when you fall short of two years
If you sell before meeting the two-year tests, a reduced exclusion may still be available when the main reason for the sale was a work-related move, a health-related move, or an unforeseeable event. Publication 523 defines each one.
- Work: the new job location is at least 50 miles farther from the home than your old work location.
- Health: the move is to diagnose, treat or care for an illness or injury, including a family member’s, or a doctor recommended it.
- Unforeseeable events: these include destruction or condemnation of the home, a casualty loss from a disaster, death, divorce or separation, and certain job losses.
The partial exclusion is a fraction of the full amount. Take the shortest of three periods: your time living in the home, your time owning it, or the time since you last used the exclusion. Divide by 730 days and multiply by $250,000. Joint filers repeat the calculation for each spouse.
Hypothetical: a single owner lives in a Santa Rosa condo for 365 days, then takes a job 60 miles farther away and sells. The maximum exclusion is 365 ÷ 730 × $250,000, or $125,000. If a fire destroyed your home and you’re selling the lot, ask your adviser how the destruction and casualty rules apply.
Rentals, home offices, ADUs and second homes
Business or rental use is where most surprises come from. Section 121 handles it in three ways.
Depreciation is never excluded
Gain equal to depreciation allowed or allowable after May 6, 1997 can’t be excluded, even on a home that otherwise qualifies. Publication 523 treats that amount as unrecaptured section 1250 gain. If you ran a home office or rented a room and claimed depreciation, expect that amount to be taxable.
A separate unit is allocated
Publication 523 distinguishes space within the home, such as a home office, from a separate dwelling, such as the other half of a duplex. For the separate space, gain on the rental portion generally can’t be excluded and is reported on Form 4797. For a property with a detached rental unit, talk with your adviser about how the IRS rules apply before you price the sale. Our guide to homes with an ADU covers the property side.
Nonqualified use after 2008
Section 121(b)(5) assigns part of the gain to any time after 2008 when the property wasn’t your main home, and that part can’t be excluded. The allocation is a simple ratio: nonqualified time over total ownership time.
Hypothetical: you buy a Sonoma cottage in January 2016, rent it out for four years, then live in it for six years and sell. Four of ten years were nonqualified use, so 40% of the gain (apart from depreciation) is taxable. The rest can be excluded up to the cap.
The order of events matters. Time after you last lived in the home, within the five-year window, isn’t nonqualified use. An owner who moves out and rents the house can still use the exclusion, apart from depreciation, if the sale closes while the two-of-five-year tests are still met, which in practice means within three years of moving out. For more, read about selling a California rental and converting a vacation home or exchange property to a residence.
Special situations
- Surviving spouse. If you haven’t remarried, you can count your late spouse’s ownership and residence time. The $500,000 limit can still apply if you sell within two years of the death and the other conditions are met. See selling a home after a spouse dies.
- Divorce. A spouse who receives the home in a divorce counts the former spouse’s ownership period. A spouse who moves out still counts as using the home while the other lives there under a divorce or separation instrument. Our post on selling a home after divorce covers the sale itself.
- Military, foreign service and intelligence personnel. On qualified extended duty, you can suspend the five-year period for up to 10 years.
- Inherited homes. California’s Schedule D instructions say the basis of inherited property is generally its fair market value at the date of death. Heirs who sell soon after inheriting often have little gain; see our guide to selling an inherited house in California.
- A loss. The IRS says losses from selling personal-use property, such as your home, aren’t tax deductible.
What happens in escrow and at tax time
- Form 593 for California withholding. Escrow will ask you to complete it. The FTB’s 2026 instructions let you certify an exemption if the home qualifies under section 121, or if it was last used as your main home even without two years of use. The second exemption doesn’t apply if the last use was as a rental, second home or vacation home. Our Form 593 guide covers the rest.
- Form 1099-S. The escrow or title company may issue one reporting gross proceeds. The IRS says that if you receive a 1099-S, you must report the sale even if all of the gain is excludable.
- Your returns. If you got no 1099-S and can exclude all the gain, you generally don’t report the sale federally. Otherwise, gain goes on Form 8949 and Schedule D, and on California’s Schedule D (540) where state and federal figures differ.
- The state filing duty. The FTB notes that claiming a withholding exemption doesn’t remove your duty to file and pay any tax owed on the sale.
Selling costs also reduce your gain, so it helps to estimate them before you decide on timing. A seller net sheet lays out commissions, transfer taxes and other charges.
Planning a sale with a large gain
Most of the decisions that change the tax bill happen before the listing goes live. A few to raise with your tax adviser:
- Check the date you’ll cross 24 months of ownership and use, and the three-year mark if you’ve moved out.
- Assemble basis records now, while contractors and old statements can still be found.
- If part of the property was ever rented, find out how much depreciation was taken or allowable.
- If you’re 55 or older and buying a replacement home, Proposition 19 may allow you to transfer your assessed value to the new home. That’s a property tax rule, separate from income tax; see our Prop 19 base year transfer guide and our post on downsizing in the North Bay.
This is general information, not tax or legal advice. Before you set a sale date, have a California CPA or enrolled agent review your basis records, any rental or office use, and the gain estimate for your situation.
Questions people ask
How much capital gains tax will I pay on a California home sale?
It depends on your gain after the exclusion and your total income for the year. Gain above the $250,000 or $500,000 exclusion is taxed federally as a capital gain and by California as ordinary income, at your regular state rates.
Does California follow the $250,000 and $500,000 exclusion?
Yes. Revenue and Taxation Code section 17152 applies section 121 for California, with modifications such as a Peace Corps reduction of the two-year period and a rule for taxpayers who file jointly federally but can’t file a joint state return.
Is there a capital gains break for seniors selling a home?
There’s no age-based exclusion in current law. Seniors use the same two-of-five-year tests, though time in a licensed care facility can count as residence for an owner who can no longer care for themselves and lived in the home at least one year of the five.
Can I avoid capital gains tax by buying another house?
Not by itself. Section 121 has no rollover rule, so buying another home doesn’t change the tax on the one you sold. A 1031 exchange applies to investment or business property, not to a main home.
Do I have to report the sale if all my gain is excluded?
If you received Form 1099-S, the IRS says yes, report it even though the gain is excludable. If you didn’t receive one and all the gain is excluded, you generally don’t report it.
I rented my house after moving out. Can I still exclude the gain?
Possibly, if you sell while you still meet the two-of-five-year tests. Time after you last lived there doesn’t count as nonqualified use, but depreciation taken during the rental years is taxable.
Will escrow withhold California tax from my proceeds?
Not if you certify on Form 593 that the home qualifies as your principal residence or was last used as your main home. Otherwise escrow generally withholds 3 1/3% of the sales price, or tax on the estimated gain if you elect that method.
Knowing your likely sale price is the first input your tax adviser will ask for. Request a home valuation from Diamond, and we’ll prepare a pricing opinion and a net sheet you can take to that meeting.
Sources & notes
- Internal Revenue Service: Publication 523 (2025), Selling Your Home
- Cornell Law School LII: 26 U.S. Code section 121
- Internal Revenue Service: Topic no. 701, Sale of your home
- Internal Revenue Service: Topic no. 409, Capital gains and losses
- Internal Revenue Service: Topic no. 559, Net investment income tax
- California Public Law: Revenue and Taxation Code section 17152
- Franchise Tax Board: Capital gains and losses (updated Jan. 28, 2026)
- Franchise Tax Board: 2025 Instructions for Schedule D (540)
- Franchise Tax Board: 2026 Instructions for Form 593
Last reviewed October 2026 by Matthew Martinez.