Every California family that sells a home and buys in the Texas Hill Country assumes the capital gains bill will be small, because the IRS lets most people exclude most of it. That assumption is usually right, and it is also exactly where the trap is set. The rules that protect a $500,000 gain have quiet edges: a five-year clock that starts the day you move out, a two-year use test measured backward from the closing date, and a California withholding machine that collects 3.33% of the gross sale price before you ever see the wire [1][8].
This article is a plain-English map of those edges, written the way I talk to clients before they pick a sale date. It covers how the Section 121 exclusion actually works, the timing mistake that erases it, how California taxes the part the exclusion does not shield, why a 1031 exchange never applies to your primary residence, and the exact sequence of dates I recommend families put on their calendar before listing [1][5][9][11].
Where the Trap Is Set: The $500,000 Exclusion Most Sellers Assume They Qualify For
Section 121 of the Internal Revenue Code lets a married couple filing jointly exclude up to $500,000 of gain from the sale of their principal residence, and singles up to $250,000 [1][2]. The exclusion is not a reward for staying in one house forever. It is a reward for a simple test, and the test has three parts, all measured on the date the sale closes:
- Ownership: you must have owned the home for at least two of the five years before the sale.
- Use: you must have used it as your principal residence for at least two of those five years.
- Frequency: you cannot have used the exclusion on another home within the two years before this sale [1].
California conforms to Section 121, so the same exclusion shields the gain on your California state return too [5]. That conformity is the part most articles skip, and it is genuinely good news for a relocating family: the protected slice of your gain is protected twice over, federally and in California, and Texas, having no state income tax, stays out of the way entirely [12].
The 2-of-5 Test, Read the Way an Escrow Calendar Reads It
| Part of the test | Requirement | Why it traps sellers |
|---|---|---|
| Ownership | Owned the home 2 of the 5 years before the sale | Almost always satisfied; rarely the problem |
| Use | Lived in it as your principal residence 2 of the 5 years | Fails only if you barely lived there, or rented it out too long |
| Time | Sale closes within 5 years after your last day of residency, with limited exceptions | The rent-it-out-for-a-few-years plan quietly runs this clock out |
| Exclusion amount | $250,000 single / $500,000 married filing jointly | Divorced or single filers get half the shield |
Rules per IRS Publication 523 and Topic 701 [1][2]. Military and certain extended-absence exceptions apply to the time test; a real estate attorney or CPA should confirm your specific dates.
The Clock Nobody Shows Californians: Five Years, Starting the Day You Move Out
Here is the timing fact that surprises almost every client: the five-year window in the use test is measured backward from the sale, which means the day you move out starts a clock. Live in the home for a decade, leave, and sell eleven months later, and you are fully protected, because the two years of use are still inside the five-year lookback [1]. Leave, rent the house out for three years and a half, and the clock has swallowed the exclusion entire.
The rental conversion is the quiet trap because it feels reversible. Families list the house at a stubborn price, the market softens, they rent it out for a season, and then a season becomes three years. The sale eventually happens on a date where the last qualifying use is more than five years behind it. No paperwork, no government notice, no scary letter. The exclusion is simply gone, replaced by a fully taxable gain that runs through federal, California, and net investment income taxes at the same time [1][3][4][5].
There is a second, less famous edge inside the window itself: the nonqualified-use rule. Even if the sale happens within five years, any period after 2008 during which the home was not your principal residence (a rental run, for instance) prorates the excluded gain, and depreciation taken during the rental years is taxed at the 25% unrecaptured Section 1250 rate, outside the ordinary capital gains brackets [1][4]. The takeaway is not algebra. It is that the rental detour has a price even when it fits inside five years.
The Move-Out Clock, in Years
Illustrative framing of IRS Publication 523 timing rules [1]. Bars show relative magnitude, not a tax calculation.
The California Side of the Same Sale: Source Income, Residency, and a 3.33% Withholding
Moving to Texas does not erase California from the transaction. California Revenue and Taxation Code Section 17951 taxes nonresidents on California-source income, and the gain on the sale of California real estate is about as California-source as income gets [9]. The state does not need you to still live there. It needs the property to have been there, and it collects what it is owed through the escrow table rather than an April check.
In practice, that means two things every relocating seller will meet.
First, the 3.33% withholding. When a nonresident sells California real property, escrow must hold back 3.33% of the gross sale price and remit it to the Franchise Tax Board on Form 593 [8]. On a $1.5 million sale that is $49,950 held before you see a cent, even if your taxable gain after the exclusion is small. The withholding is a prepayment, not a final tax: you square it up on the California nonresident return (Form 540NR) and get the overpayment back. But it lands in escrow at closing unless you act first [8].
Second, the reduced withholding election. If your CPA prepares the gain math before closing, escrow can withhold based on the taxable gain instead of the gross price, or withhold nothing when there is no tax due, through the Form 593 election [8]. This is a paperwork-before-closing exercise. Close first and the full 3.33% goes to the FTB, and the refund ride takes months.
And the closer the sale sits to your departure date, the more California's residency rules lean in. The FTB applies a closest-connections test under its residency guidelines, and a sale in the same tax year as the move invites part-year scrutiny [6][7]. The clean fix is documentation: Texas driver's license, voter registration, medical and financial records moved, an address change trail, and a sale date that follows a real break [6][7][10]. Do it twice, once on paper and once in behavior, and the California return stays the simple nonresident version.
The withholding number to know
A $1,500,000 sale by a nonresident seller triggers $49,950 in California withholding (3.33% of the gross price) at closing [8]. With a CPA-prepared Form 593 election before close, the holdback can be based on the actual taxable gain, which in the worked example below is far smaller [8]. Without it, you wait on the refund.
The 1031 Misconception: Why the Exchange Rule Never Applies to the Home You Live In
A surprising share of the families I talk with ask, in good faith, whether rolling their California sale into a Texas purchase defers the tax through a 1031 exchange. The answer is no, and knowing why saves both money and a bad-advice detour.
Section 1031 allows the deferral of gain on like-kind exchanges of property held for investment or used in a trade or business. A home you live in is neither, so a primary residence can never ride a 1031 exchange [11]. The tool that protects your home sale is Section 121, the exclusion covered above, and it requires no replacement purchase at all [1]. That is a feature, not a catch: you can sell in California, land in Texas, rent for a year, and take your time buying, without a 45-day identification clock or a 180-day closing clock running over your head [11].
The confusion usually comes from sellers who once owned an investment property. If you own a California rental and a California home, the rental can qualify for a 1031 into a Texas investment property, while the home uses Section 121 on its own sale. The two rules are separate engines, and mixing them up gets expensive [1][11].
The Real Math: One Bay Area Sale, With and Without the Shield
A worked example makes the stakes concrete. Take a married couple whose Bay Area home was purchased in 2012 for $720,000, improved over the years at a documented cost of $80,000, and now sells for $1,500,000. The numbers are chosen to be ordinary, not dramatic, and every line is stated so you can run your own [1][4].
Gain Calculation, Line by Line
| Line | Amount | How it is derived |
|---|---|---|
| Contract sale price | $1,500,000 | Assumed scenario |
| Selling costs (5% commission, ~1% closing) | - $90,000 | Typical ranges; actual costs vary |
| Amount realized | $1,410,000 | Price minus seller costs |
| Original purchase (2012) | - $720,000 | Assumed scenario |
| Documented improvements | + $80,000 | Adds to basis |
| Adjusted basis | $800,000 | Purchase plus improvements |
| Gain before exclusion | $610,000 | Realized minus basis |
| Section 121 exclusion (MFJ) | - $500,000 | Married filing jointly [1] |
| Taxable gain after exclusion | $110,000 | The only number the tax tables see |
Illustrative model built on the stated assumptions, not a quote or an estimate for any property [1][2].
On that $110,000 of taxable gain, the tax stack runs three layers. Federal long-term capital gains at the 15% bracket: about $16,500. The 3.8% net investment income tax if household income is above the threshold: about $4,180 [3]. California, which taxes capital gains as ordinary income, at roughly a 9.3% bracket: about $10,230 [5][9]. The combined bill lands near $30,900 before credits.
Now run the same sale without the exclusion, as happens when the use test fails. The full $610,000 gain becomes taxable: 20% federal, $122,000, plus the 3.8% NIIT, $23,180, plus California at the top ordinary bracket, $75,030 [3][4][5]. The bill is roughly $220,210. The exclusion is worth about $189,000 on this one ordinary sale. That is the entire trap in a single number.
How Much of the Gain Goes to Tax
Illustrative comparison on the worked example above. Federal rates, the NIIT, and California brackets are explained in the sources [3][4][5].
The Timing Blueprint: How to Sequence the Sale and the Purchase
The good news is that nothing about this requires genius. It requires a calendar and a CPA conversation. Here is the sequence I hand to clients who ask me to sanity-check a relocation timeline:
- Confirm the 2-of-5 math before you list. Write down the last date the home was your principal residence, count five years forward from it, and put that expiration date on the family calendar. Every listing plan lives inside that window [1].
- Decide the rental question on purpose. If you rent the California home while waiting on the Texas market, know the maximum safe rental span in advance: roughly three years from move-out to sale inside the five-year lookback, with nonqualified-use proration shrinking the shield even within it [1].
- Pick the closing date with the tax year in mind. The closing date sets the sale's tax year, which matters for the NIIT threshold and for your California part-year return [3][6]. Couples with a lumpy income year sometimes prefer a closing in the lower-income year. Confirm with a CPA rather than a gut feel.
- Lodge the California paper early. Give your CPA the purchase documents, improvement receipts, and the adjusted-basis worksheet at least a month before closing, so the reduced-withholding election on Form 593 reaches escrow in time [8].
- Document the residency break before the sale, not after. Texas driver's license, voter registration, utilities, medical records, and an address trail dated before or at the move, so the California return is the clean nonresident version [6][7].
- Buy in Texas on your own schedule. Because the home sale exclusion requires no replacement purchase, you are free to rent first, wait for the right house, and close when the market and your life agree, with no 1031 clocks running [1][11].
- File the 540NR and close the loop. Reconcile the withholding against the actual California tax and collect the refund, then file your Texas homestead exemption in the purchase year so the recurring bill is as small as the law allows [8][12].
Six Mistakes That Quietly Erase the Savings
| Mistake | What it costs |
|---|---|
| Listing before confirming the 2-of-5 use test | A sale that fails the test becomes fully taxable, the $189,000-style gap above [1] |
| Renting the home out and losing track of the five-year clock | The exclusion expires without any notice; the gain is taxed in full [1] |
| Assuming a 1031 covers the primary residence | Missed planning time; 1031 clocks do not apply and the exclusion gets no attention [11] |
| Closing without the Form 593 election in place | 3.33% of the gross price held at closing, then a months-long wait for the refund [8] |
| Selling in the same tax year as a soft California tie | Part-year scrutiny on the California return and a harder residency argument [6][7] |
| Ignoring the NIIT threshold when choosing the close date | 3.8% on the taxable slice when household income crosses the line in the sale year [3] |
Each row traces to the cited source; the dollar figures follow the worked example above.
Before You Pick a Date, Run the Calendar
The trap in this article is not a rare corner case. It is the ordinary outcome of a lovely-sounding plan: move first, rent the California house, buy slowly in Texas, and sell when the market finally cooperates. The only reason that plan works is the five-year clock, and the clock is easy to miss because nobody sends you a warning when it expires.
I walk every California family through this exact sequence before they list, with their own purchase price, improvements, sale target, and move date. It costs an hour and usually settles the matter for good, and there is no pressure attached to it. The date is the cheapest decision in the whole move to get right, and the most expensive one to guess at.
Written by
Bill Ross
Hill Country Homesteads Group, brokered by KW Boerne
Bill Ross is a Texas real estate agent (TX License 778434) whose practice is built on guiding out-of-state relocations, with a direct network of 1,100+ California real estate agents for coordinated cross-state sales. Recognized in USA Today and The Washington Post for relocation expertise. His family made the same Silicon Valley to the Hill Country transition.
Related Guides
The Capital Gains Trap, Three Scenarios
The earlier companion piece works three real sale profiles through the same rules, with per-scenario exclusion and tax math.
The 2-Year Residency Rule
The residency-clock rules that decide whether your sale falls inside the exclusion window, explained with dates.
California 3.33% Withholding Guide
How the nonresident withholding works at closing, the Form 593 election, and how it interacts with federal FIRPTA.
Changing Residency Legally
The domicile factors and documentation the Franchise Tax Board weighs when you leave California for Texas.
California Equity to Texas Wealth
The line-by-line version of a $1.2 million sale into a $650,000 Boerne purchase, from seller costs to monthly carry.
Coordinate the Sale and Purchase
Bridge loans, contingencies, and synchronized closings for selling one state while buying in another.
Frequently Asked Questions
These are the questions that come up in the second conversation, after the initial walk-through of the rules, the ones that show whether a family is really planning the date or just hoping the math works out.
Do I have to live in Texas for two years before I can sell my California home and use the exclusion?
No, the two-year clock is measured backward from the sale date, not from your arrival in Texas. If you owned and lived in the California home as your principal residence for at least two of the five years before the sale, you can sell the week you move and still use the full Section 121 exclusion [1][2]. The trap runs in the other direction: sell too soon after buying, or rent the California home for more than three years after moving out, and the exclusion can disappear [1].
If I sell my California home after moving to Texas, does California still tax the gain?
Yes, on the gain that is left after the exclusion. California treats the profit from selling California real estate as California-source income even when the seller now lives in Texas [5][9]. The good news is that California conforms to Section 121 for a principal residence, so the same $500,000 exclusion (married filing jointly) shields the gain here too [5]. Only the gain above the exclusion is California-taxable, and the mechanics of collecting it, including the 3.33% withholding at closing, surprise a lot of sellers [8][9].
Can a 1031 exchange defer the tax if I roll my California sale into a Texas home?
No, and this is the most common misunderstanding of the whole series. Section 1031 applies only to investment or business property, never to a home you live in [11]. A primary residence gets its tax break through Section 121, the home sale exclusion, and you do not need to buy a replacement home to use it. Buying in Texas is a lifestyle and wealth decision, not a tax trigger for that sale [1][11].
How long can I rent out my California home before the exclusion expires?
The safe window is defined by the five-year lookback: you must have owned and used the home as your principal residence for two of the five years ending on the sale date [1]. Practically, that means about three years of vacancy or rental after you move out, at most, and the nonqualified-use rules can shrink the excluded portion even inside that window [1]. If the plan is to rent for four or five years and then sell, plan on the exclusion being reduced or gone and structure accordingly [12].
What exactly sets the tax year of the sale, and why does the closing date matter?
For tax purposes the sale happens on the closing or escrow date, not the day your for-sale sign goes up or the contract is signed [2]. That date fixes which tax year the gain lands in, which matters for the federal net investment income tax threshold and for your California part-year return. Couples retiring midyear sometimes prefer a closing that lands in the lower-income year, and that is a conversation for a CPA before the date is set, not after [3][6].
Sources
- IRS Publication 523, Selling Your Home, including the Section 121 exclusion: Internal Revenue Service. www.irs.gov/publications/p523
- IRS Topic No. 701, Sale of Your Home: Internal Revenue Service. www.irs.gov/taxtopics/tc701
- IRS, Net Investment Income Tax (NIIT): Internal Revenue Service. www.irs.gov/individuals/net-investment-income-tax
- IRS Tax Topic 409, Capital Gains and Losses: Internal Revenue Service. www.irs.gov/taxtopics/tc409
- Income from the Sale of Your Home, including California conformity to Section 121: California Franchise Tax Board. www.ftb.ca.gov/file/personal/income-types/income-from-the-sale-of-your-home.html
- Part-Year Resident and Nonresident status: California Franchise Tax Board. www.ftb.ca.gov/file/personal/residency-status/part-year-and-nonresident.html
- Guidelines for Determining Resident Status (Publication 1031): California Franchise Tax Board. www.ftb.ca.gov/forms/2025/2025-1031-publication.pdf
- Instructions for Form 593, Real Estate Withholding, and the 3.33% withholding rules: California Franchise Tax Board. www.ftb.ca.gov/forms/2026/2026-593-instructions.html
- California Revenue and Taxation Code Section 17951, taxation of nonresidents on California-source income: California Legislative Information. leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=RTC§ionNum=17951
- Publication 1100, Taxation of Nonresidents and Individuals Who Change Residency, on California-source income: California Franchise Tax Board. www.ftb.ca.gov/forms/misc/1100.html
- Like-Kind Exchanges, Real Estate Tax Tips (Section 1031): Internal Revenue Service. www.irs.gov/newsroom/like-kind-exchanges-real-estate-tax-tips
- Texas Comptroller of Public Accounts, tax FAQs including the absence of a state income tax: State of Texas. comptroller.texas.gov/faq/
Last reviewed: September 22, 2026. This article explains federal and California tax rules as published by the IRS and the California Franchise Tax Board, and the worked example is an illustrative model built on the stated assumptions, not a quote, appraisal, or tax return. It is general information rather than legal, tax, or financial advice, and tax law changes. Verify every date and number with your own CPA before you set a closing date.