How Long Do You Have to Buy a House After Selling: The Two-Year Rule

There is no federal deadline to buy another house after selling your home. Since 1997, the tax code has not required you to reinvest the proceeds to avoid capital gains tax on a primary residence. If you meet the ownership and use tests under Section 121 of the Internal Revenue Code, you can exclude up to $250,000 of gain as a single filer or $500,000 as a married couple filing jointly, then rent, travel, or simply hold the cash for as long as you like. The strict timelines you may have heard about apply to investment property sold through a 1031 exchange, not to the home you actually lived in.

Why There Is No Reinvestment Deadline on Your Primary Home

Before 1997, federal tax rules did force homeowners to roll their sale proceeds into a replacement home of equal or greater value to defer capital gains tax.1Board of Governors of the Federal Reserve System. The Effect of Capital Gains Taxation on Home Sales: Evidence from the Taxpayer Relief Act of 1997 The Taxpayer Relief Act of 1997 replaced that rollover rule with a straight exclusion. Under current law you can sell, pocket the profit, and never buy another home without owing federal tax on the gain, as long as you qualify.

The Section 121 exclusion shields up to $250,000 of gain for a single filer and up to $500,000 for a married couple filing jointly.2Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence To claim the full $500,000 on a joint return, at least one spouse must meet the ownership requirement and both spouses must meet the use requirement.

The ownership and use tests both look back five years from the date of sale. You must have owned the home for at least two of those years and lived in it as your principal residence for at least two of those years.3Internal Revenue Service. Selling Your Home The two years do not have to run consecutively. Any 24 months, or 730 days total, inside that five-year window will satisfy the test.

Nothing in Section 121 asks what you do with the money afterward. Buy immediately, buy in five years, or never buy at all. The exclusion still applies.

The One Timing Rule That Does Exist

The exclusion can only be used once every two years. If you claimed Section 121 on another home sale within the two-year period ending on the date of your current sale, you cannot claim it again.2Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence A homeowner who sells, buys a new home, and then sells that new home 18 months later would owe tax on the second sale’s gain.

This is a limit on how often you can use the exclusion, not a deadline to reinvest. It only becomes relevant if you sell a second home quickly.

If You Sell Before Hitting Two Years

Falling short of the two-year ownership or use requirement does not automatically wipe out the tax break. If you sold early because of a job change, a health issue, or certain unforeseen circumstances, you may qualify for a reduced exclusion proportional to the time you did live in the home.2Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

The math is simple. Divide the months you lived in the home by 24, then multiply by the full exclusion amount. A single filer who lived in the home for 12 months before a qualifying job transfer could exclude up to $125,000 (12 ÷ 24 × $250,000).

Qualifying reasons include:3Internal Revenue Service. Selling Your Home

  • An employment change where the new work location is at least 50 miles farther from the home than your previous workplace.
  • A move to obtain, provide, or facilitate medical care for yourself or a family member dealing with disease, illness, or injury.
  • Unforeseen circumstances such as death of a spouse, divorce, legal separation, becoming eligible for unemployment compensation, or becoming unable to pay basic living expenses because of a change in employment status.

The partial exclusion also overrides the two-year frequency limit. A taxpayer who used the full exclusion recently can still claim a proportional amount on an early sale triggered by one of these events.

Surviving Spouses

If your spouse has died, you can still claim the $500,000 exclusion as an unmarried individual, provided you sell the home within two years of your spouse’s death and the ownership and use requirements were met immediately before that date.2Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

When Gain Exceeds the Exclusion

If your profit runs past the $250,000 or $500,000 limit, or you do not qualify for any exclusion, the taxable portion is subject to capital gains tax. The rate depends on how long you owned the home and on your taxable income.

For homes held longer than one year, long-term capital gains rates for 2026 are:4Internal Revenue Service. Revenue Procedure 2025-32 – 2026 Adjusted Items

  • 0% on taxable income up to $49,450 (single), $98,900 (married filing jointly), or $66,200 (head of household).
  • 15% on taxable income above the 0% threshold up to $545,500 (single), $613,700 (married filing jointly), or $579,600 (head of household).
  • 20% on taxable income above the 15% threshold.

If you owned the home for one year or less, any gain is treated as short-term and taxed at your ordinary income rate, which can be considerably higher.

High-income sellers face an additional 3.8% Net Investment Income Tax on home sale profits that exceed the Section 121 exclusion. This surtax applies when modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately).5Internal Revenue Service. Topic No. 559 – Net Investment Income Tax Gain that qualifies for the Section 121 exclusion is not counted as net investment income, so this surtax only reaches the portion above the $250,000 or $500,000 cap.6Internal Revenue Service. Net Investment Income Tax

Investment Property Is a Different Story

If the property you sold was a rental or business property rather than a home you lived in, none of the above applies. There is no Section 121 exclusion for investment real estate. Instead, Section 1031 of the Internal Revenue Code lets you defer capital gains tax by exchanging the property for another investment property of like kind, and the timing rules are unforgiving.7Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment

Two deadlines run at the same time, both starting the day you close on the sale:

  • Within 45 days you must formally identify potential replacement properties in writing. There is no extension for weekends, holidays, or delays.
  • Within 180 days of the sale, or by the due date of your tax return for that year including extensions if that comes first, the entire exchange must close.7Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment

Miss either deadline and the capital gain is recognized immediately. For investment property that often includes depreciation recapture, where previously claimed depreciation deductions are taxed at a maximum rate of 25%, on top of the standard long-term capital gains rate on any remaining profit.8Internal Revenue Service. Topic No. 409 – Capital Gains and Losses

A qualified intermediary must hold the sale proceeds during the exchange period. You cannot take possession of the money at any point between the sale and the purchase of the replacement property. Touching it disqualifies the exchange. The intermediary cannot be someone who has acted as your agent, attorney, accountant, or broker within the prior two years.

Reporting the Sale

Even when Section 121 covers your entire gain, you may still need to report the sale. If your gain is fully excluded but you receive a Form 1099-S from the closing agent, report the sale on your return anyway.

When your gain exceeds the exclusion, or you do not qualify for any exclusion, report the sale using Schedule D (Form 1040) and Form 8949.9Internal Revenue Service. Topic No. 701 – Sale of Your Home If you also owe the 3.8% Net Investment Income Tax on the portion above your exclusion, file Form 8960 as well.6Internal Revenue Service. Net Investment Income Tax

Keep records of your original purchase price, the cost of any major improvements, and all closing costs from both the purchase and the sale. Those figures set your cost basis and determine the actual taxable gain. IRS Publication 523 walks through the full calculation.