$Missed Deductions

Can I exclude gain on selling my home if I used it as a rental?

Home Buyingadvanced3 answers · 6 min readUpdated February 28, 2026

Quick Answer

You can partially exclude gain from selling your home even if you used it as a rental, but you must pay tax on depreciation claimed (up to 25% rate) and may lose some of the $250,000/$500,000 exclusion. If you rented it for 2 of the last 5 years, you'd lose 40% of your exclusion eligibility.

Best Answer

MW

Michelle Woodard, Tax Policy Analyst

Best for homeowners who rented out their primary residence for part of the ownership period

Top Answer

How rental use affects your home sale exclusion


Yes, you can still exclude some or all of your gain when selling a home that was used as a rental, but the calculation becomes more complex. The key is understanding that the IRS treats your home as having two distinct periods: personal use and rental use.


The depreciation recapture requirement


First, you must pay tax on any depreciation you claimed (or should have claimed) while the property was a rental. This depreciation is taxed at up to 25%, regardless of your regular tax rate.


Example: You bought your home for $400,000 and claimed $20,000 in depreciation over 4 years of rental use. When you sell for $600,000, that $20,000 depreciation must be "recaptured" and taxed at 25% = $5,000 in additional tax, even if you qualify for the home sale exclusion on the remaining gain.


Partial exclusion for non-qualifying use periods


Under IRC Section 121(b)(4), you lose part of your exclusion ($250,000 single, $500,000 married) based on how long the home was used as rental property after May 6, 2008.


Formula: Exclusion × (Non-qualifying use years ÷ Total ownership years)


Worked example: Mixed-use home sale


Scenario: Sarah owned her home for 10 years total:

  • Years 1-6: Primary residence
  • Years 7-9: Rental property (3 years)
  • Year 10: Moved back in before selling

  • Sale details:

  • Purchase price: $300,000
  • Sale price: $550,000
  • Total gain: $250,000
  • Depreciation claimed: $15,000

  • Tax calculation:

    1. Depreciation recapture: $15,000 × 25% = $3,750

    2. Remaining gain: $250,000 - $15,000 = $235,000

    3. Exclusion reduction: 3 non-qualifying years ÷ 10 total years = 30%

    4. Reduced exclusion: $250,000 × (100% - 30%) = $175,000

    5. Taxable gain: $235,000 - $175,000 = $60,000


    Total tax owed:

  • Depreciation recapture: $3,750
  • Capital gains on remaining: $60,000 × 15% = $9,000
  • Total: $12,750

  • Important exceptions and planning opportunities


    The "last 5 years" rule: Rental use in the last 5 years before sale reduces your exclusion. But rental use earlier in ownership doesn't count against you.


    Temporary absences: Short-term rentals (under 2 years) for job relocation or other temporary reasons may not count as "non-qualifying use."


    Separate structure rentals: If you rented out a separate unit (like a basement apartment) while living in the main home, this may not affect your exclusion if properly structured.


    What you should do


    1. Gather records of all rental periods, depreciation claimed, and home improvements

    2. Calculate your potential tax liability using the mixed-use formula

    3. Consider timing - moving back into a rental property for 2+ years before selling can preserve more of your exclusion

    4. Consult a tax professional for complex situations involving multiple properties or business use


    Use our [return scanner](return-scanner) to identify if you've properly reported rental income and claimed appropriate depreciation on past returns.


    Key takeaway: You can still get significant tax savings when selling a former rental home, but expect to pay tax on depreciation claimed plus potentially reduced exclusion benefits based on rental use periods.

    *Sources: [IRC Section 121](https://www.law.cornell.edu/uscode/text/26/121), [IRS Publication 523](https://www.irs.gov/pub/irs-pdf/p523.pdf)*

    Key Takeaway: Rental use doesn't eliminate the home sale exclusion, but you'll pay 25% tax on depreciation claimed and lose exclusion benefits proportional to non-qualifying use periods.

    Tax impact comparison based on rental use periods

    Rental PeriodExclusion ReductionExample Loss on $500K GainDepreciation Impact
    1 year of 10 owned10%$25,000 less exclusion25% tax on depreciation
    3 years of 10 owned30%$75,000 less exclusion25% tax on depreciation
    5 years of 10 owned50%$125,000 less exclusion25% tax on depreciation
    No rental use0%Full exclusion availableNo depreciation to recapture

    More Perspectives

    RK

    Robert Kim, Tax Return Analyst

    Best for investors who live in properties before converting to rentals or vice versa

    Strategic considerations for real estate investors


    As a real estate investor, the mixed-use home sale rules create both challenges and opportunities for tax optimization.


    The "live-in then rent" strategy


    Many investors buy properties, live in them for 2+ years to qualify for the exclusion, then convert to rentals. This can work, but timing is crucial.


    Example: You buy a duplex for $400,000, live in one unit for 3 years, then rent both units for 7 years before selling for $700,000. Your $300,000 gain gets complex treatment:

  • Personal use period: 3 years
  • Rental period: 7 years
  • Exclusion reduction: 70% (7÷10 years)
  • Remaining exclusion: $250,000 × 30% = $75,000
  • Plus depreciation recapture on the entire $50,000 claimed

  • The "rent then live" opportunity


    Converting a rental back to your primary residence can preserve more exclusion benefits, but you need to live there 2 of the last 5 years before sale.


    Multi-unit properties


    For properties with separate living units, the IRS may allow you to allocate the exclusion to your personal residence portion only. This requires careful documentation and often professional guidance.


    Key planning points


  • Track basis improvements separately for personal vs. rental periods
  • Consider 1031 exchanges instead of sale if you don't qualify for meaningful exclusion
  • Time your moves strategically - 2 years of personal use can save thousands in taxes
  • Document everything - the IRS scrutinizes mixed-use property sales closely

  • *Key insight: Real estate investors should run the numbers before selling any former personal residence - the tax savings from strategic timing can be substantial.*

    Key Takeaway: Investors can still benefit from home sale exclusions through strategic timing, but need careful planning around the 2-year personal use requirement and depreciation recapture rules.

    MW

    Michelle Woodard, Tax Policy Analyst

    Best for homeowners currently planning to sell a property with rental history

    What to do when you're ready to sell


    If you're selling a home that was previously used as a rental, preparation is key to minimizing your tax liability and avoiding IRS problems later.


    Essential documentation to gather


    Rental period records:

  • Lease agreements with start/end dates
  • Tax returns showing rental income and depreciation
  • Records of when you moved out and back in
  • Utility bills, homeowners insurance changes

  • Financial records:

  • Original purchase documents and closing statement
  • All home improvement receipts (separate personal vs. rental period)
  • Depreciation schedules from all rental years
  • Current appraisal or BPO

  • Common mistakes to avoid


    Not claiming required depreciation: If you should have claimed depreciation but didn't, the IRS still requires you to "recapture" it as if you had claimed it.


    Mixing personal and rental expenses: Keep clear records of which improvements were made during personal vs. rental use periods.


    Ignoring the May 6, 2008 rule: Only non-qualifying use after this date counts against your exclusion.


    Your selling timeline


    1. 6 months before listing: Gather all documentation and calculate potential tax liability

    2. 3 months before: Consider whether moving back in temporarily makes sense

    3. At closing: Ensure your settlement statement properly allocates costs

    4. Tax time: File Form 8949 and Schedule D, potentially with professional help


    When professional help pays off


    Consider hiring a tax professional if:

  • Your potential tax liability exceeds $5,000
  • You have multiple rental periods or properties
  • You're unsure about depreciation claimed in prior years
  • State taxes add complexity

  • *Bottom line: With proper planning and documentation, you can minimize taxes even when selling a former rental property - but preparation is essential.*

    Key Takeaway: Proper documentation and advance planning can minimize taxes when selling a former rental home, but professional help often pays for itself on complex mixed-use sales.

    Sources

    home sale exclusionrental propertysection 121depreciation recapturemixed use property

    Reviewed by Michelle Woodard, Tax Policy Analyst on February 28, 2026

    This content is for educational purposes only and is not a substitute for professional tax advice. Consult a qualified tax professional for advice specific to your situation.