Selling a Former Home You’ve Been Renting Out: The Three-Year Capital Gains Rule

capital-gains-home-rented-out

DISCLAIMER

Nothing on this page should be considered to be tax, accounting, legal, or investment advice. If you need a referral to an expert in these areas, please feel free to contact me and I will provide you with amazing people who can help you with this.

Written By Seb Frey, Broker Associate at Compass, Certified Senior Advisor (CSA) and Seniors Real Estate Specialist (SRES), CA DRE# 01369847. Affiliate Member, Professional Fiduciary Association of California (PFAC).

Key Takeaways

To use the home sale exclusion ($500,000 for a married couple, $250,000 if you’re single), you must have owned and lived in the home as your main home for at least two of the five years before the sale. In practice that gives you about three years from the day you move out to close escrow.
Renting the house during those three years doesn’t trigger the nonqualified use rule, because time after you last lived there doesn’t count against you as long as you sell inside the window.
Depreciation you took, or were allowed to take, while renting is never covered by the exclusion. It’s taxed federally at up to 25 percent and by California as ordinary income.
If you’re still inside the window, you can combine the $500,000 exclusion with a 1031 exchange and defer the rest of the gain, including the depreciation.
Once the window closes, the entire gain is taxable unless another strategy applies, such as a 1031 exchange, an installment sale, or holding the house so your heirs receive a stepped-up basis.

Summary: If you moved out of your Silicon Valley home and rented it, you generally have about three years to sell and still take the $250,000 or $500,000 home sale exclusion. Depreciation from the rental years is taxed separately no matter what, and in a typical San Jose example, missing the deadline adds roughly $175,000 or more in federal and California tax.

A pattern I see regularly: a couple moves from San Jose to be near grandchildren in Santa Cruz or Sacramento, or into a 55-plus community, and instead of selling the family home, they rent it out. It feels smart at the time. The rent is strong, the house is paid off, and maybe the market will keep rising. Then a few years later they decide to sell and discover that the $500,000 home sale exclusion is gone, they owe tax on depreciation, and the gain is far larger than they expected. There’s a three-year rule that decides much of this, and knowing it before you rent, or before that third year runs out, can easily be worth more than $150,000. This article is part of my guide to capital gains when selling a Silicon Valley home you have owned for 30 years or more.

How the Three-Year Window Works

Under Section 121 of the tax code, you can exclude up to $250,000 of gain, or $500,000 for a married couple filing jointly, if you owned the home and used it as your main home for at least two of the five years before the sale. The two years don’t have to be consecutive, but for most longtime owners the math is simple. If you lived in the home until the day you moved out, you have three years from that day to sell and still show two years of use in the last five. After that, the exclusion is gone. For tax purposes the sale date is generally the day escrow closes and title transfers, not the day you accept an offer, so give yourself room for preparation, marketing, and a 30-day escrow. California follows the federal rule on this, so the same exclusion applies to your state return.

A San Jose Example

A couple lived in their Cambrian Park home for 30 years, moved to a 55-plus community in January 2022, and rented the house out. Their basis, meaning what they paid plus improvements, is $400,000, and the building portion of that basis is $220,000, which works out to $8,000 a year of depreciation over 27.5 years. Here’s what happens if they sell for $1,900,000 with $110,000 of selling costs, inside the window versus 20 months after it closed. To keep the comparison clean, I’ve used the same sale price in both columns.

Sold January 2025, inside the window Sold September 2026, window missed
Sale price minus $110,000 of selling costs $1,790,000 $1,790,000
Depreciation allowed while rented $24,000 (3 years) About $37,000 (4 years, 8 months)
Adjusted basis ($400,000 minus depreciation) $376,000 About $363,000
Total gain $1,414,000 About $1,427,000
Depreciation portion, taxed separately at up to 25 percent federally $24,000 About $37,000
Home sale exclusion ($500,000) None
Remaining taxable gain at capital gains rates $890,000 $1,390,000

Waiting past the window added $500,000 of taxable capital gain here, plus about $13,000 more depreciation. On a sale this size, that extra $500,000 is taxed at the top federal capital gains rate of 20 percent, plus the 3.8 percent net investment income tax that applies to rental property gains, plus California’s ordinary income rates, which run 11.3 to 13.3 percent at this level. That’s roughly $175,000 or more in additional tax for missing a deadline by 20 months. The figures are illustrative, and your CPA will calculate the actual depreciation and basis. If you want to run your own numbers, try my capital gains calculator, and see how to document improvements that raise your basis.

Cover of the free Capital Gains Strategy Guide for Long-Time Homeowners

Free 2026 Strategy Guide

28 legal ways long-time owners cut their capital gains tax. Know your options before you list.

After decades in Silicon Valley, your gain can blow past the $250,000 and $500,000 exclusions. The guide walks through each strategy, a real bracket-by-bracket example, and what to settle before you list.

No account required. Your information will never be given, sold, or shared with any unaffiliated third party.

Depreciation: The Part People Forget

When a home becomes a rental, the owner is supposed to depreciate the building, not the land, over 27.5 years. The starting figure is the lower of your adjusted basis or the home’s fair market value on the day it became a rental, and in Silicon Valley the land is often most of the value, so the depreciable piece can be smaller than people assume. Even if you never claimed depreciation, the IRS treats you as having taken what you were allowed, which it calls “allowed or allowable.” That amount reduces your basis and is taxed when you sell, federally at a maximum 25 percent rate, and by California as ordinary income. The home sale exclusion doesn’t shelter it, even if you sell inside the window. If you rented the house and your tax preparer never put it on Schedule E with a depreciation schedule, fix that before you sell, because the tax is owed either way and claiming it at least gets you the deductions you were entitled to. IRS Publication 527 covers the rules for residential rentals.

What About the Nonqualified Use Rule?

Since 2009, gain allocated to periods when a home wasn’t used as a main residence is generally not eligible for the home sale exclusion. That rule mostly affects people who rented a property first and moved in later, or who moved out, rented it, and then moved back. Periods after you last lived in the home, within the five-year window, aren’t counted as nonqualified use. So a couple who lived in their home for decades and then rented it for up to three years before selling is generally not hurt by this rule. They just need to sell in time.

Still Inside the Window? Combine the Exclusion With a 1031 Exchange

This is the strategy most owners and many advisors miss. Once you’ve rented the house, it qualifies as investment property, and if you’re still inside the three-year window it also qualifies for the home sale exclusion. IRS Revenue Procedure 2005-14 allows you to use both on the same sale. You take the $500,000 exclusion first, then exchange the rest into other investment property through a qualified intermediary and defer the remaining gain, including the depreciation. In the example above, the couple could have kept the $500,000 exclusion and deferred tax on the other $914,000 by buying a rental or a share of a commercial property. It only works if you plan it before the sale closes, so bring in your CPA and an exchange accommodator early. See the benefits of a 1031 exchange in San Jose for the basics.

Icon of a caregiver helping a person in a wheelchair into a home, with a dollar sign

Moving to assisted living?

Need move-in money in a hurry?

Move-in fees and first months' rent can top $20,000 within days. Compass Concierge can now cover them, repaid when the house sells.

See How It Works →

Need help today? Call or text 408.413.3087

If a Parent Moved Into Assisted Living

Adult children often call me after Mom or Dad has moved into assisted living or memory care and the family has rented the house to cover the cost. There’s a special rule worth knowing here. If an owner becomes physically or mentally unable to care for themselves and lived in the home for at least one of the five years before the sale, time spent in a licensed care facility can count as time living in the home. That can stretch the window well beyond three years. How rental use during that time interacts with the rule is a question for the family’s CPA, but it’s worth asking before anyone assumes the exclusion is lost. I go into more detail in the home sale exclusion when moving to assisted living.

A real example: One set of owners I worked with had rented out their hillside home for the last ten years before they decided to sell. The exclusion was long gone, so the question became how to avoid handing a large share of decades of appreciation to the IRS and the Franchise Tax Board. They sold as-is for $1,195,000 and rolled the proceeds into a 1031 exchange, which deferred the entire gain. If you’ve moved out and are renting your former home, mark the three-year date on your calendar now, because it decides which tax tools you’ll have when you sell.

Options if You’re Past the Window

  • A 1031 exchange. Because the home is now investment property, you may be able to exchange it for other investment property and defer the entire gain, including depreciation. You have 45 days to identify replacement property and 180 days to close, and you must use a qualified intermediary. Many older owners exchange into lower-maintenance property such as a Delaware Statutory Trust.
  • Hold for the step-up. If the owner keeps the property until death, the heirs generally receive a stepped-up basis that eliminates both the gain and the depreciation. In California, community property can get a step-up on both halves when the first spouse dies. See sell now or let the kids inherit and the community property double step-up.
  • Installment sale. Spreading payments over several years can keep more of the gain in lower brackets. The 25 percent depreciation portion is reported first as payments come in, and any depreciation on appliances or other personal property is taxed in the year of sale. Read more about structured installment sales.
  • Move back in. This rarely works well for older owners. You’d need two more years of living there, the rental years count as nonqualified use, and the depreciation is still taxed.

Adult daughter and her mother reviewing a transition plan together at the kitchen table

Free 2-minute family assessment

Worried about Mom and Dad? See If It's Time to Have The Talk.

Answer a dozen quick questions about what you've noticed, the house itself, and who in the family is involved. You'll get an honest read on how urgent things really are and a plan for starting the conversation without a family fight.

Take the Quiz →

Rather talk now? Call or text 408.413.3087

California Withholding at Closing

One more surprise shows up in escrow. When a property no longer qualifies as your principal residence, California generally requires the escrow company to withhold 3 1/3 percent of the sales price and send it to the Franchise Tax Board, unless you elect to have withholding figured on the actual gain using Form 593. On a $1,900,000 sale that’s about $63,000 held back at closing. It isn’t an extra tax, since it’s credited against your California return, but it affects how much cash you walk away with and how you fund a 1031 or a move. The rules are in FTB Publication 1016.

Single, Married, or Recently Widowed

The $500,000 figure assumes a married couple filing jointly where at least one spouse owned the home and both lived in it for two of the last five years. A single owner gets $250,000. A surviving spouse can still claim the full $500,000 if the house sells within two years of the spouse’s death and the couple met the rules before the death, which matters for widows and widowers who rented the house after a loss. See the widow’s $500,000 exclusion and the two-year rule.

My Advice Before You Rent

If you’re moving and considering renting the old house, put the three-year date on your calendar the day you move. Decide in advance whether this is a short rental while the market or your plans settle, in which case plan to list within about two and a half years to leave time for preparation and escrow, or a long-term investment, in which case talk to a CPA about 1031 exchanges and estate planning. Also keep in mind that once you factor in maintenance, management, vacancies, and tenant protections, renting out a Silicon Valley house often returns less than people expect, and selling a tenant-occupied home takes more planning. See sell, rent, or keep for the rental math, which is similar for your own former home, how much capital gains tax you’ll pay in California for a full worked example, and go back to capital gains when selling a Silicon Valley home you have owned for 30 years or more for the full picture.

Sources and Further Reading

White-gloved butler presenting a home on a silver tray, Seb Frey's market-ready concierge service

Does your home need some work first?

Let's get it market-ready, and pay for it at closing.

Paint, repairs, flooring and staging, all handled for you through Compass Concierge with nothing out of pocket up front and no contractors for you or your family to manage.

See How It Works →

Rather talk now? Call or text 408.413.3087

Frequently Asked Questions

Can I still get the capital gains exclusion if I rented out my home?

Yes, if you owned it and lived in it as your main home for at least two of the five years before the sale. For most people that means closing escrow within about three years of moving out.

Do the two years of living in the home have to be consecutive?

No. The two years of use can be any 24 months within the five years before the sale. For longtime owners who moved out and rented, it usually works out to a three-year deadline from the move-out date.

Is depreciation recapture covered by the home sale exclusion?

No. Depreciation taken or allowable while the home was rented is taxed separately, federally at up to 25 percent and by California as ordinary income, even if you sell inside the three-year window.

What is the nonqualified use rule?

Since 2009, gain allocated to periods when the home wasn’t your main residence generally can’t be excluded. Periods after you last lived in the home, within the five-year window, aren’t counted, so renting after you move out isn’t penalized if you sell in time.

Can I use the home sale exclusion and a 1031 exchange on the same sale?

Yes, if you’re still inside the window. Revenue Procedure 2005-14 lets you exclude up to $500,000 and then defer the remaining gain, including depreciation, by exchanging into other investment property.

What if I have rented my old home for more than three years?

The exclusion is generally lost. Options include a 1031 exchange into other investment property, an installment sale, or holding the house until death so the heirs receive a stepped-up basis.

Will escrow withhold California tax when I sell a former home I rented out?

Usually, yes. If the home no longer qualifies as your principal residence, escrow generally withholds 3 1/3 percent of the sales price for the Franchise Tax Board unless you elect withholding based on the actual gain. It’s credited against your California tax.

Does renting my house affect the step-up for my heirs?

No. If you still own the house at death, your heirs generally receive a stepped-up basis, which also wipes out the prior depreciation.

Free Cash-Out Strategy Call

You've spent decades building equity. Let's make sure you take as much of it with you as possible.

Selling a long-held California home and moving somewhere new comes down to a few big questions. We'll look at what your home should sell for, what you'll actually net after taxes and costs, and how to time the sale with your next purchase so you're never stuck in between. You'll leave with real numbers and a plan, whether or not you hire me.

Book My Cash-Out Strategy Call →
Book a cash-out strategy call with Seb Frey

Senior Friendly Homes in Silicon Valley South

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Check out this article next

Willow Glen: Why It's My Favorite Neighborhood In San Jose

Willow Glen: Why It's My Favorite Neighborhood In San Jose

TakeawaysWillow Glen is a historic district of San Jose in ZIP code 95125 (with parts of 95126), roughly bounded by Interstate 280 to the north,…

Read Article
About the Author
seb-headshot-smile-deskew

I specialize in helping families with homeowners over 60 plan and confidently execute their next move for a clear financial advantage. Since 2003, I’ve helped Bay Area clients navigate complex housing decisions using deep Silicon Valley market knowledge and practical, real-world strategy. My goal is to help clients move forward with clarity and confidence as they enter their next chapter.