# How Soon After Selling a House Do You Have to Buy to Avoid Capital Gains?

By Opendoor Editorial Team | 2026-05-04


Here's the short answer: **you don't have to buy another house at all.** The old "rollover" rule that required reinvestment was eliminated in 1997.

Today, the relevant law is the **Section 121 exclusion** — and it has nothing to do with whether you buy another home. Here's what actually matters.

## The Old Rule vs. The Current Law

**Before 1997:** There was a "rollover provision" that allowed homeowners to defer capital gains if they bought a replacement home of equal or greater value within 2 years. This rule no longer exists.

**Since 1997:** The Tax Relief Act replaced rollover deferral with a permanent exclusion. You can exclude up to **$250,000 in gains (single)** or **$500,000 (married filing jointly)** from taxable income — regardless of what you do with the proceeds.

You do not have to reinvest in another home, buy within any time window, or notify the IRS of your intention to buy again. The exclusion is automatic if you qualify.

## The Section 121 Exclusion: How It Works

To qualify for the exclusion, you must meet the **2-of-5-year ownership and use test:**

- You must have **owned** the home for at least 2 of the last 5 years before the sale
- You must have **lived in it as your primary residence** for at least 2 of the last 5 years
- The 2 years of ownership and use **do not have to be consecutive**

If you meet the test, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of profit from the sale.

**Example:**

- Bought in 2018 for $300,000, sold in 2026 for $550,000
- Gain: $250,000
- Single filer: $250,000 gain — fully excluded. Tax owed: $0
- Married couple: $250,000 gain — fully excluded. Tax owed: $0

## What If Your Profit Exceeds the Exclusion?

If you profit more than the exclusion amount, only the **amount above the threshold** is taxable.

| Filing Status | Exclusion | Example Gain | Taxable Amount |
| --- | --- | --- | --- |
| Single | $250,000 | $300,000 | $50,000 |
| Married (joint) | $500,000 | $650,000 | $150,000 |
| Single | $250,000 | $200,000 | $0 (fully covered) |
| Married (joint) | $500,000 | $480,000 | $0 (fully covered) |

The taxable amount is subject to **long-term capital gains rates** if you owned the home for more than a year:

- 0% if your taxable income is below ~$47,000 (single) or ~$94,000 (married) in 2026
- 15% for most taxpayers
- 20% for high earners (above ~$518,000 single / ~$583,000 married)

This is significantly lower than ordinary income tax rates.

## Calculating Your Actual Gain (It's Less Than You Think)

Your **taxable gain** is not simply the sale price minus what you paid. You can reduce your gain by:

- **Selling costs:** Agent commissions, closing costs, transfer taxes
- **Home improvements:** Capital improvements you made during ownership (a new roof, kitchen remodel, HVAC replacement — not routine maintenance)
- **Depreciation recapture adjustments:** If you ever claimed a home office deduction

**Adjusted basis formula:** Purchase price + improvements + buying costs − selling costs = adjusted basis Sale price − adjusted basis = taxable gain (before exclusion)

**Example:**

- Purchase: $350,000
- Improvements: $40,000 (kitchen, roof)
- Selling costs: $25,000 (agent + closing)
- Adjusted basis: $365,000
- Sale price: $600,000
- Gain: $235,000
- Single exclusion: $250,000 → fully excluded, $0 tax

## Situations That Affect the Exclusion

### You haven't lived there for 2 years

If you owned the home but rented it out or lived elsewhere, you may not qualify for the full exclusion. You need **2 years of primary residence use**, not just ownership.

### You used it as a rental and claimed depreciation

If you rented the property and claimed depreciation deductions, you may owe **depreciation recapture tax** (taxed at up to 25%) on the depreciated amount — even if the gain is otherwise excluded. Consult a tax professional here.

### You sold within 2 years of a previous exclusion

You can only use the Section 121 exclusion once every 2 years. If you sold another home and used the exclusion recently, you'll need to wait.

### Partial exclusion for shorter ownership

If you don't meet the full 2-year test, you may still qualify for a **partial exclusion** if you're selling due to:

- Change in employment
- Health reasons
- Unforeseen circumstances (divorce, death of a spouse, military deployment)

The partial exclusion is prorated by the fraction of 2 years you actually lived there.

### Divorce

If one spouse lived in the home and the other didn't, special rules apply. A divorcing or divorced spouse may be able to count the other spouse's use toward the 2-year test in certain situations.

### Military and foreign service exemption

Active duty military, Foreign Service officers, and intelligence employees can **suspend the 5-year window for up to 10 years** while on extended duty orders, effectively extending the window within which they can qualify.

## Do You Have to Tell the IRS?

Generally, **no** — if your gain is fully excluded, you don't need to report the sale at all. But you should report it if:

- Your gain exceeds the exclusion
- You received a Form 1099-S from the closing
- You had depreciation recapture to address

When in doubt, report it. The IRS cross-references 1099-S forms and may inquire if a property sale isn't reflected on your return.

## What About Move-Up Buyers?

Many Opendoor sellers are also buyers — they're selling one home to buy a better one. The good news: these transactions are completely separate for tax purposes.

You can:

- Sell your current home and use the Section 121 exclusion on any gain
- Buy the next home whenever you want — no deadline, no reinvestment requirement
- Use the proceeds however you choose — all-cash purchase, bigger down payment, or just keeping the rest

## Frequently Asked Questions

### Do I have to buy another house to avoid capital gains?

No. The rollover rule that required reinvestment was eliminated in 1997. Today's Section 121 exclusion lets you exclude $250k–$500k of gain regardless of what you do with the proceeds.

### How long do I have to live in my house to avoid capital gains?

You must have used the home as your primary residence for at least 2 of the last 5 years before the sale. The 2 years don't have to be consecutive.

### What if I only lived there for 1 year?

You may qualify for a partial exclusion if you're selling due to job relocation, health, or unforeseen circumstances. The exclusion is prorated: 1 year of use out of the required 2 years = 50% of the full exclusion ($125k single, $250k married).

### Can I use the exclusion more than once?

Yes, but only once every 2 years. If you sell your primary residence frequently (e.g., house-flipping), you can only exclude gains once per 2-year period.

### What's the capital gains tax rate on a home sale?

Long-term capital gains rates (for homes held more than 1 year) are 0%, 15%, or 20% depending on your income. These apply only to gains that exceed the Section 121 exclusion. Most middle-income sellers pay 15%.

### Does selling my house count as income?

Only the taxable portion (gains exceeding the exclusion) is treated as capital gain income. The excluded amount doesn't appear on your tax return at all.

## The Bottom Line

The tax question sellers actually face isn't "how long do I have to buy another house" — it's "does my gain exceed $250,000 (single) or $500,000 (married)?"

For most sellers, the answer is no — and the exclusion covers the full gain. For those with larger gains, only the amount above the threshold is taxable, at favorable long-term capital gains rates.

If you're selling and buying in the same market, read our complete guide on [how to buy a house](/articles/how-to-buy-a-house) and [whether now is a good time to buy](/articles/is-now-a-good-time-to-buy-a-house).

For complex situations — significant gains above exclusion limits, rental history, depreciation recapture, or divorce — consult a qualified tax professional.

---
*Originally published at [https://www.opendoor.com/articles/avoid-capital-gains-tax-when-selling-house](https://www.opendoor.com/articles/avoid-capital-gains-tax-when-selling-house)*

<!-- structured-data
{
  "@context": "https://schema.org",
  "@type": "Article",
  "@id": "https://www.opendoor.com/articles/avoid-capital-gains-tax-when-selling-house",
  "mainEntityOfPage": "https://www.opendoor.com/articles/avoid-capital-gains-tax-when-selling-house",
  "dateModified": "2026-05-04T15:11:42.474Z",
  "datePublished": "2026-05-04T00:00:00.000Z",
  "image": [
    "https://images.ctfassets.net/bjlp9d7o6h1o/4KYrlwK1KnRUCo7LM6uglT/7b850d4d594bb7386c67647b8c1424f8/061ffa73d5e231ba7edd16d9c978e96f02ac0a17",
    "https://images.opendoor.com/source/s3/imgdrop-production/1afd9b4404c54cd5bd4d3737eec0d70d.jpg?preset=square-2048"
  ],
  "inLanguage": "en-US",
  "headline": "How Soon After Selling a House Do You Have to Buy to Avoid Capital Gains?",
  "description": "You don't have to buy another house to avoid capital gains. The old rollover rule was eliminated in 1997. Learn how the Section 121 exclusion works and when gains are taxable.",
  "author": [
    {
      "@type": "Person",
      "name": "Opendoor Editorial Team"
    }
  ]
}
-->