For U.S. readers: This article discusses U.S. rules and financial products. State rules and individual eligibility may differ.
Capital Gains Tax on the Sale of a Second Home

Gain on the sale of a personal second home is generally taxable because the principal-residence exclusion normally applies only to a qualifying main home.
Practice trading with Finelo
Practice in a simulator, learn with bite-sized lessons, and build confidence before risking real money.
Want to learn more?
Practice in a simulator, learn with bite-sized lessons, and build confidence before risking real money.
Explore FineloExplore Finelo's 28-day challenges
Turn learning into a daily habit with guided challenge paths.
Quick answer
Gain on the sale of a personal second home is generally taxable because the principal-residence exclusion normally applies only to a qualifying main home. Calculate the result by subtracting adjusted basis and selling expenses from the amount realized. A loss on a second home held for personal use is generally not deductible.
Moving into a vacation or former rental home before selling it does not automatically make all gain excludable. The two-out-of-five-year ownership and use tests, the post-2008 nonqualified-use rules, and depreciation claimed or allowable after May 6, 1997 can leave part of the gain taxable. The current worksheet and examples are in IRS Publication 523.
Finelo provides general financial education, not tax, legal, real-estate, financial, or investment advice. Property use, depreciation, co-ownership, state tax, and prior home sales can materially change the calculation.
First classify how the property was used
The correct tax treatment depends on the property's actual use, which can change over time.
| Use before sale | General federal treatment |
|---|---|
| Personal vacation or second home | Gain is generally taxable; personal-use loss is generally nondeductible |
| Main home meeting Section 121 rules | Some gain may qualify for exclusion, subject to limits and exceptions |
| Rental or investment property | Gain, depreciation, passive-activity rules, and Form 4797 may apply |
| Mixed personal and rental use | The result may need allocation and separate depreciation analysis |
| Property converted from second home to main home | Section 121 nonqualified-use and depreciation rules may limit the exclusion |
If a home was sometimes rented, assemble the dates of personal use, rental use, vacancy, and main-home use before estimating tax.
How to calculate gain
Step 1: determine the amount realized
Start with the sale price and subtract qualifying selling expenses, such as a real-estate commission and certain legal or closing costs directly connected with the sale.
Step 2: calculate adjusted basis
Adjusted basis generally starts with acquisition cost, including qualifying purchase expenses, then:
- adds documented capital improvements;
- adds certain assessments or restoration costs when tax rules permit;
- subtracts depreciation allowed or allowable for rental or business use; and
- reflects other basis adjustments described in IRS guidance.
Routine repairs and maintenance usually do not increase basis unless they are part of a larger qualifying improvement. Keep closing statements, invoices, permits, depreciation schedules, and insurance or casualty records.
Step 3: subtract basis from the amount realized
Gain or loss = amount realized − adjusted basis

Hypothetical example:
- sale price: $420,000;
- qualifying selling expenses: $24,000;
- original cost and qualifying acquisition expenses: $250,000;
- documented capital improvements: $35,000; and
- depreciation allowed or allowable: $15,000.
Amount realized is $396,000. Adjusted basis is $270,000 ($250,000 + $35,000 − $15,000). The preliminary gain is $126,000. The character and rate treatment still depend on holding period, depreciation, property use, and any available exclusion. This example is educational and does not calculate a tax bill.

When the main-home exclusion may apply
The IRS generally requires the taxpayer to have owned and used the property as a main home for at least two years during the five-year period ending on the sale date. The maximum exclusion is generally up to $250,000, or up to $500,000 for certain joint filers, but eligibility involves additional conditions, including limits based on another home-sale exclusion.
A second home used only for vacations does not qualify merely because it was owned for two years. “Use” means use as the main home, not occasional occupancy.

Converting a second home to a main home
Conversion requires more than satisfying the basic two-year use test. Publication 523 explains that gain allocated to certain periods of nonqualified use after 2008 cannot be excluded. In a common pattern—second home or rental first, main home later—a fraction of the otherwise eligible gain may remain taxable.
Depreciation allowed or allowable for rental or business use after May 6, 1997 is also not sheltered by the Section 121 exclusion. That amount may be treated as unrecaptured Section 1250 gain or otherwise reported under the applicable rules.
Do not use a simple “live there for two years and all gain is tax-free” rule. Build a dated use timeline and complete the current Publication 523 worksheets.

Personal use, rental use, and depreciation
When the property was rented:
- depreciation reduces basis even if the owner failed to claim all depreciation that was allowable;
- gain attributable to depreciation is not eligible for the home-sale exclusion;
- passive-activity losses may be released or limited depending on the disposition and ownership facts;
- part of the sale may be reported on Form 4797; and
- rental and personal periods can affect whether Section 121 or Section 1031 applies.
Ask the preparer to reconcile every prior depreciation schedule to the sale calculation. Missing a year of depreciation does not necessarily preserve basis.
Can a 1031 exchange defer the gain?
Section 1031 generally applies only to real property held for investment or productive use in a trade or business. A property held solely as a personal vacation home does not qualify. IRS Publication 544 explains the current like-kind exchange rules, and IRS Revenue Procedure 2008-16 describes a safe harbor for certain dwelling units.
A qualifying exchange requires more than renting the home briefly before sale. Intent, actual use, identification and exchange deadlines, related-party rules, intermediaries, debt, cash received, and replacement-property use all matter. Obtain advice before listing or transferring the property; a sale completed first usually cannot be converted into a deferred exchange afterward.
Practice trading with Finelo
Practice in a simulator, learn with bite-sized lessons, and build confidence before risking real money.
What if the sale produces a loss?
A loss on property held for personal use is generally nondeductible. This includes a personal vacation home or second residence. A Form 1099-S may still create a reporting requirement even when the loss is nondeductible.
Property genuinely converted to income-producing use before sale may have different loss-basis rules. The deductible loss basis may be limited based on fair market value at conversion, so a later rental period does not necessarily make the earlier personal decline deductible.

What if the second home was inherited or gifted?
Inherited property generally has a basis tied to fair market value at the applicable valuation date, but exceptions and estate elections can apply. Obtain the estate appraisal and documents rather than assuming basis equals the later sale price.
Gifted property uses different carryover and dual-basis rules. The basis used to calculate gain may differ from the basis used to calculate loss. A donor's purchase price alone may be incomplete if gift tax, depreciation, or improvements affected basis.
Federal reporting and state tax
A taxable sale may involve Form 8949, Schedule D, Form 4797, and depreciation or installment-sale forms. A Form 1099-S does not itself determine the taxable gain; it is an information return that must be reconciled with basis and selling costs.
State rules can differ from federal law on exclusions, rates, depreciation, withholding at closing, and residency. A property in one state owned by a resident of another can create filing obligations in both.
Records to gather before sale
- purchase and refinancing closing statements;
- sale contract and estimated closing statement;
- invoices and proof of payment for capital improvements;
- casualty, insurance, or energy-credit records affecting basis;
- rental dates, leases, income, expenses, and depreciation schedules;
- dates the property was used as the main home;
- records of any prior Section 121 exclusion;
- appraisal and estate records for inherited property; and
- donor basis records for gifted property.
Create the use-and-basis timeline before accepting a sale structure or assuming an exclusion.
Common mistakes
Treating every renovation as a basis increase
Repairs and personal decorating are not automatically capital improvements. Classification and documentation matter.
Assuming two years of occupancy shelters all gain
Nonqualified-use and depreciation rules can keep part of the gain taxable even after the ownership and use tests are met.
Treating a personal loss as deductible
A personal-use second-home loss is generally not deductible. A conversion to rental use has special loss-basis rules.
Assuming every rental qualifies for Section 1031
Section 1031 requires investment or business holding and a properly structured exchange. Personal-use property does not qualify merely because it generated occasional rent.
Forgetting state tax and nonresident withholding
Federal exclusion or deferral does not guarantee identical state treatment.
FAQ
Is gain on a vacation home taxed at capital-gains rates?
Often, but holding period, depreciation, and other tax items affect character and rate. The sale may include more than one category of gain.
Can stock losses offset gain on a second-home sale?
Capital losses may offset capital gains under the normal netting rules, but depreciation-related gain and other categories can have distinct treatment. Use Schedule D and Form 4797 instructions for the actual calculation.
Can I deduct the cost of a new roof?
A qualifying replacement that materially adds value, prolongs useful life, or adapts the property may increase basis, subject to tax rules and documentation. A repair to maintain ordinary condition may not.
If I receive Form 1099-S, must I report the sale?
The form is a strong indicator that the transaction must be reconciled on the return. Publication 523 and the Form 8949 instructions explain reporting, including situations involving an excluded gain or nondeductible loss.
What is the best official source for the calculation?
Use IRS Publication 523 for a home-sale exclusion and nonqualified-use analysis, and IRS Publication 544 for investment property, depreciation, and like-kind exchanges.
Bottom line
A personal second-home gain is generally taxable, while a personal-use loss is generally nondeductible. A later move into the property may create a partial Section 121 exclusion, but post-2008 nonqualified use and depreciation can leave gain taxable. Classify each period of use, reconstruct adjusted basis, and apply the current IRS worksheets before relying on a tax estimate.
Practice trading with Finelo
Practice in a simulator, learn with bite-sized lessons, and build confidence before risking real money.
About the author
Finelo Team
The Finelo Team creates practical investing and trading education designed to help beginners learn faster with structured challenges, simulator practice, and bite-sized lessons.
Keep reading — Related articles

Mercury Books Review 2026: Is It Worth It for Startups?
Mercury Books brings double-entry accounting into Mercury. Review its $35 pricing, reports, AI features, integrations, and migration limits.

Why is My FICO Score Lower Than My Credit Score?
Example takeaway: seeing a higher score in a bank app doesn’t guarantee lenders will see the same FICO number at application time; lenders often pull a specific FICO version from a specific bureau.

Why Is My FICO Score Higher Than My Credit Score?
Brief educational note: this article is educational, not financial or investment advice; investing and credit decisions involve risk and possible loss.