InSight

Selling Your Home? The Section 121 Exclusion, the 1031 Five-Year Rule, and the Planning Most Owners Miss

Financial Planning Dentist

Selling a long-held home can produce substantial wealth, and a tax bill that is not apparent from the sale price alone. Federal rules may allow qualifying homeowners to exclude a significant portion of their gain, but prior rental use, depreciation, time spent away from the home, and an earlier like-kind exchange can change the result.

The federal home sale exclusion under Internal Revenue Code Section 121 is one part of the decision. For Boulder County homeowners, where property appreciation can push gains beyond the statutory limits, the sale should also be coordinated with cash flow, investments, state taxes, and estate planning. That broader view is central to comprehensive financial planning and to making a well-informed real estate decision.

How the Section 121 exclusion works

Section 121 generally allows an eligible taxpayer to exclude up to $250,000 of gain on the sale of a principal residence. A qualifying married couple filing jointly may be able to exclude up to $500,000.

To qualify, a taxpayer generally must:

  • Meet the ownership test: own the property for at least two years during the five-year period ending on the sale date.
  • Meet the use test: use it as a principal residence for at least two years during that same five-year period. The two years need not be continuous, and the ownership and use periods do not have to be identical.
  • Meet the look-back test: generally, not have claimed the exclusion on another home sale during the two-year period before the current sale.

For a joint return claiming the full $500,000 limit, both spouses generally must meet the use test and look-back test, while at least one must meet the ownership test. Special rules and exceptions can apply. The IRS explains the tests and exceptions in Publication 523, Selling Your Home.

The home sale exclusion applies to the sale of a taxpayer’s main home, not a second home or vacation property simply because it is owned for many years. A person can have only one principal residence at a time. The IRS evaluates the facts, including where a taxpayer spends time and the address used on tax returns, a driver’s license, and other records.

Gain above the available exclusion may be taxable. If the property has been held for more than one year, the remaining eligible gain is generally long-term capital gain, subject to the taxpayer’s circumstances and other applicable taxes. That is why estimating the capital gains tax on a home sale requires calculating gain, not just comparing the purchase price with the eventual sale price.

Calculate gain and review the residence timeline

A preliminary gain estimate starts with the amount realized from the sale, generally reduced by eligible selling expenses, and subtracts the home’s adjusted basis. The basis typically includes the purchase cost and qualifying capital improvements, and is reduced by items such as depreciation. Ordinary maintenance and repairs generally do not add to basis.

Keep records that can support both the calculation and the residence timeline:

  • Closing statements from the purchase and sale
  • Receipts and invoices for capital improvements
  • Prior tax returns and depreciation schedules
  • Rental agreements and records of business use
  • Documents that help establish where you lived and when

These records help a CPA determine the amount of gain, the amount potentially excludable, and whether any portion has a different tax treatment. Organized documentation supports greater certainty and control at tax time.

Homeowner reviewing property records and sale documents in a bright Colorado home

Two limitations can reduce the exclusion

Nonqualified use

For periods after 2008, certain periods during which neither the taxpayer nor a spouse used the property as a principal residence can make part of the gain ineligible for the home sale exclusion. In general, the rule applies to nonqualified-use periods that occur before the property’s final qualifying period of principal-residence use. Gain is allocated between qualifying and nonqualified use under the statutory formula.

There is an important exception: the period after the last date the home was used as a principal residence generally is not treated as nonqualified use if it falls within the five-year period ending on the sale date. This means moving out and then renting the home does not automatically create nonqualified-use gain. Other exceptions also apply, so the dates and circumstances matter.

A vacation home converted to a principal residence can present a different issue. The earlier period of vacation or investment use may count as nonqualified use, even if the owner later satisfies the two-year residence test. The exclusion may therefore apply to only part of the gain. The IRS’s Publication 523 includes examples and worksheets for this calculation. Reviewing the timeline before setting a sale date can improve planning efficiency.

Depreciation

Gain attributable to depreciation allowed or allowable for periods after May 6, 1997, cannot be excluded under Section 121. This applies to depreciation tied to prior rental or business use, including depreciation that could have been claimed but was not.

The depreciation-related gain is generally treated as unrecaptured Section 1250 gain, subject to a maximum federal rate of 25%; the actual tax depends on the taxpayer’s situation. This treatment is separate from the regular long-term capital-gain calculation. It is often the most commonly missed tax consequence when owners evaluate the home sale exclusion.

For long-held properties in places such as Niwot and Gunbarrel, past rental activity can leave a depreciation-related tax liability even when the owner otherwise meets the residence tests. A CPA should review depreciation schedules and prior returns before the sale. The IRS discusses depreciation and asset dispositions in Publication 544.

The five-year rule after a Section 1031 exchange

Section 1031 generally applies to qualifying real property held for business or investment, not property held solely as a personal residence. But an owner may acquire investment property in a tax-deferred exchange and later convert it to a principal residence.

In that situation, Section 121 generally cannot apply to a sale that occurs during the five-year period beginning on the date the property was acquired in the exchange. The clock starts on the exchange acquisition date, not the date the owner moves into the property. Meeting the two-of-five-year residence test does not override this five-year restriction.

For example, someone who exchanges into an investment property, converts it to a home, lives there for two years, and then sells before the five-year period has ended generally cannot claim the Section 121 exclusion. If the sale occurs after that period, the taxpayer may qualify if the other requirements are met. Depreciation-related gain still cannot be excluded.

Congress enacted this limitation to prevent gain that was deferred through Section 1031 from being permanently excluded under a provision intended for a taxpayer’s principal residence. The home sale exclusion may still provide a planning opportunity after the five-year period, but the timeline and tax history must be carefully reviewed. The IRS statute, Section 121, Publication 523, and Publication 544 address the applicable rules.

When a sale may receive split treatment

A property that has served both personal and investment or business purposes may, in some circumstances, receive treatment under both Section 121 and Section 1031. Revenue Procedure 2005-14 explains how the provisions can work together in a qualifying exchange, and the U.S. Treasury’s announcement summarizes the guidance.

The general sequence is to apply Section 121 first to eligible gain, then determine whether Section 1031 can defer remaining gain attributable to qualifying investment or business property. Depending on the circumstances, mixed-use property or a distinct portion not associated with the residence may be relevant. A principal residence alone does not qualify for a 1031 exchange; the investment portion must independently meet the applicable requirements, including qualifying replacement property.

An allocation between residential and investment portions must be reasonable and supported. The IRS may examine the method, such as the relative fair market values or an allocation consistent with depreciation records. For a qualifying exchange, the tax treatment of excluded gain can also affect boot and replacement-property basis. This is not a do-it-yourself allocation: it requires tax advice and advance coordination with a qualified intermediary when Section 1031 is being considered. The benefit is an informed comparison between an outright sale and a properly structured exchange.

Colorado home with a distinct detached cottage, illustrating how different property portions may have different uses

Coordinate the sale with the rest of your financial plan

The decision to sell, hold, rent, or pursue an exchange should account for more than the federal home sale exclusion. Consider how the choice affects:

  • Cash flow and investments: Estimate net sale proceeds after mortgage payoff, transaction costs, taxes, and any reinvestment.
  • Colorado taxes: Colorado’s individual income tax rate is 4.4% for 2026. Gain taxable federally may also affect Colorado tax. The final state calculation depends on the taxpayer’s facts.
  • Itemized deductions: Property taxes may be deductible subject to applicable limitations, while transfer taxes generally are not Schedule A deductions. See IRS Topic 503 and the IRS itemized deduction guidance. For broader local context, see our articles on Boulder County financial planning, planning for new construction and metro districts in Erie, and the SALT cap and a Boulder home.
  • Estate planning: Holding property until death may allow a basis adjustment under current law, potentially eliminating income tax on some built-in gain. This is not guaranteed, and estate-tax exposure, ownership structure, liquidity needs, and future law changes all matter.

A long-term InSight-Full® financial plan brings real estate, Tax Strategy, cash flow, investments, retirement, estate planning, and risk management into one coordinated view. For households facing Complex Wealth Problems, regular oversight helps clarify trade-offs, preserve flexibility, and support disciplined decisions over time.

Conclusion: Plan the sale before choosing a date

The home sale exclusion can reduce tax on the sale of a principal residence, but it does not erase every tax consequence. Ownership and residence dates, prior claims, nonqualified use, depreciation, and a past 1031 exchange all matter. In higher-value Boulder County markets, the exclusion limit can be reached quickly, making an accurate basis calculation and tax projection especially important.

Before committing to a sale or conversion, work with a CPA and tax counsel to assess the transaction, and coordinate with a qualified intermediary if an exchange may be appropriate. This article is educational, not tax or legal advice. Tax laws change, and the analysis is fact-specific. Coordinated comprehensive financial planning helps you understand the after-tax proceeds and make a decision with greater stability and control.

More related articles:

Articles
Kevin Taylor

What to know about investments in office space

Investing in office buildings can be a lucrative opportunity for investors, but it also comes with its share of drawbacks and risks. Let’s take a closer look at some of the benefits and drawbacks of investing in office buildings. Benefits: Steady income stream: Office buildings can provide a steady income

Read More »

Pin It on Pinterest