Renting Out Your Home, Then Selling Later: the 2-out-of-5-Year Rule, Depreciation and What Changes at Tax Time
Rent out your former home and you can still exclude up to $500,000 of gain if you sell within the 2-out-of-5-year window, but the depreciation is taxed.
Contents▾
- Can you rent out your home and still avoid capital gains tax?
- What is the 2-out-of-5-year rule?
- How long can you rent before you lose the exclusion?
- Does renting count as nonqualified use?
- Depreciation while you rent
- What changes at tax time when you sell
- A worked example from IRS Publication 523
- The tax years in between: losses and the conversion year
- JBSA and the military suspension rule
- Why San Antonio owners are asking this now
- What Flat Fee Landlord does in week one
- Frequently asked questions
- Sources and last reviewed
Rent out your former home and you can still exclude up to $500,000 of gain if you sell within the 2-out-of-5-year window, but the depreciation is taxed.
Free Instant Rent Estimate
What could your property rent for?
Enter your property address and see an instant comps-based rent estimate — right here, no waiting.
Yes, you can rent out your former home and still exclude up to $250,000 of gain ($500,000 on a qualifying joint return) when you sell, as long as you still pass the 2-out-of-5-year rule on the day of the sale. In practice that usually means selling within about three years of moving out. Two things change because you rented: the depreciation you claimed (or could have claimed) is taxed at sale, and the clock on the exclusion keeps running the whole time a tenant lives there.
This guide is for the owner who did not plan to become a landlord. Maybe the house in Stone Oak, Alamo Heights, Schertz or New Braunfels sat on the market, maybe orders came through from Joint Base San Antonio, maybe a job moved you before the sale could close. Renting buys time. The tax rules decide how much time.
This is general information, not tax advice. Every rule below is quoted from the Internal Revenue Code or an IRS publication for 2025 returns, checked on October 23, 2026. Your dates, basis and filing status decide your answer. Have a CPA or enrolled agent confirm your numbers before you choose a sale date or a lease length.
Can you rent out your home and still avoid capital gains tax?
Mostly, if you sell in time, but not on the depreciation. The home sale exclusion in Section 121 of the Internal Revenue Code survives a rental period. It does not survive forever, and it never covers the depreciation from the rental years.
Here is the whole picture in one table.
| Question | Short answer | Where the rule lives |
|---|---|---|
| Does renting cancel the exclusion? | No. You still qualify if you pass the ownership and use tests on the sale date. | IRC §121(a); IRS Publication 523 |
| How much gain can be excluded? | Up to $250,000, or $500,000 for a married couple filing jointly who meet the joint conditions | IRC §121(b)(1) and (b)(2)(A) |
| Is the rental period "nonqualified use"? | Not if the rental comes after your last day living there, within the 5-year window | IRC §121(b)(5)(C)(ii)(I) |
| Is depreciation excluded? | No. Depreciation after May 6, 1997, allowed or allowable, is taxable | IRC §121(d)(6); Publication 523 |
| What rate applies to that depreciation? | A maximum 25% rate on unrecaptured section 1250 gain | IRS Tax Topic 409 |
| How often can you use the exclusion? | Once in any 2-year period | IRC §121(b)(3) |
What is the 2-out-of-5-year rule?
The 2-out-of-5-year rule is the test that lets you exclude gain on the sale of your home if you owned it and lived in it as your principal residence for at least 2 years during the 5 years ending on the date of sale. That is the quotable version. The statute itself, Section 121(a), says gross income does not include the gain if, "during the 5-year period ending on the date of the sale or exchange," the property "has been owned and used by the taxpayer as the taxpayer's principal residence" for "periods aggregating 2 years or more."
Three details in that sentence matter to a landlord:
- There are two tests, not one. An ownership test and a use (residence) test. Both must be met within the same 5-year look-back.
- The 2 years do not have to be continuous. Publication 523 says, "All that is required is a total of 24 months (730 days) of residence during the 5-year period."
- The window is measured backward from the sale date. It moves forward with every month you wait. That is the part renting changes.
The dollar limits are in Section 121(b). The base limit is $250,000. On a joint return it becomes $500,000 if either spouse meets the ownership test, both spouses meet the use test, and neither spouse used the exclusion on another sale in the prior 2 years. Section 121(b)(3) separately limits the exclusion to one sale in any 2-year period.
How long can you rent before you lose the exclusion?
If you lived in the home right up until you moved out, you generally have up to three years from the move-out date to close the sale. After that, your last 24 months of residence fall outside the 5-year look-back and the use test fails. For an accidental landlord the rental clock and the sale clock start on the same day.
The arithmetic is simple once you see it. The 5-year window ends on the sale date. To still contain 24 months of residence, it can contain no more than 36 months of something else, and for most owners that something else is the rental.
| Your situation | What the 5-year look-back contains at sale | Use test |
|---|---|---|
| Lived in it 4 years, rented 1 year, then sold | 4 years residence, 1 year rental | Pass |
| Lived in it 2 years, rented 3 years, then sold | 2 years residence, 3 years rental | Pass, but with no margin. Check exact day counts. |
| Lived in it 10 years, rented 3.5 years, then sold | 1.5 years residence, 3.5 years rental | Fail. The 8.5 earlier years fall outside the window. |
| Lived in it 18 months only, then rented | Never more than 18 months residence | Fail on the full exclusion. Publication 523 covers reduced exclusions for specific situations; ask a tax professional. |
The third row surprises people. Living in a house for ten years does not bank ten years of credit. Only the residence inside the 5 years before the sale counts, which is why a long-time owner can lose the exclusion just as fast as a two-year owner once the rental runs past about three years.
Practical consequence: before you sign a lease, write down the date you moved out and add three years. Then make sure any lease you sign, including renewals, ends early enough to list, sell and close before that date. A lease that runs past your deadline does not stop you from selling, but selling a tenant-occupied home on a hard deadline narrows your options.
Does renting count as nonqualified use?
Not when the rental comes after you lived there. Nonqualified use is a rule that reduces the exclusion for periods after 2008 when the home was not your principal residence. Section 121(b)(5)(A) says the exclusion does not apply to the share of gain "allocated to periods of nonqualified use."
But Section 121(b)(5)(C)(ii)(I) carves out the exact pattern most accidental landlords follow. Nonqualified use does not include "any portion of the 5-year period described in subsection (a) which is after the last date that such property is used as the principal residence of the taxpayer or the taxpayer's spouse." Publication 523 repeats this in its list of exceptions.
In plain terms:
- Live there first, rent it later, sell within the window: no nonqualified-use reduction. The full exclusion is available, minus the depreciation.
- Rent it first, move in later, then sell: the rental years before you moved in can be nonqualified use, and part of the gain is not excludable. This is a different situation and needs a tax professional.
Depreciation while you rent
Once the home is a rental, you depreciate the building, not the land, over 27.5 years. Depreciation is the annual deduction for the wear on a rental building. Publication 527 says you "must use the straight line method and a mid-month convention for residential rental property," and that you "can't depreciate the cost of land because land generally doesn't wear out."
Two conversion-specific rules set the starting number:
- Basis is the lower of two figures. When you convert a home to rental use, Publication 527 says "its basis for depreciation is the lesser of its adjusted basis or its FMV when you change it to rental use." Adjusted basis is roughly what you paid plus improvements. Fair market value is what the home was worth on the conversion date. If prices fell after you bought, you depreciate from the lower value.
- Depreciation starts when the home is ready. "You place property in service in a rental activity when it is ready and available for a specific use in that activity." That is usually the date it is listed for rent, not the date a tenant moves in.
A simple hypothetical shows the scale. Suppose the building portion of your basis (excluding land) is $275,000. Straight line over 27.5 years is $10,000 a year before the first-year and last-year mid-month adjustments. Three years of renting adds up to roughly $30,000 of depreciation. Those deductions reduce taxable rental income while you rent, and that same $30,000 comes back as taxable gain when you sell.
Our tax deductions guide for landlords covers the other deductions that come with a rental, from management fees to repairs.
What changes at tax time when you sell
At sale, the gain splits into two parts: the depreciation, which is taxable, and everything else, which the exclusion can cover. Section 121(d)(6) says the exclusion does not apply to gain that "does not exceed the portion of the depreciation adjustments" attributable to periods after May 6, 1997.
Three details catch owners off guard:
- "Allowed or allowable." Publication 523 says you "can't exclude the part of your gain equal to any depreciation allowed or allowable." Publication 527 says basis is reduced by depreciation "you deducted or could have deducted." Skipping the deduction does not avoid the tax. It only means you lose the deduction and still pay at sale.
- The rate. IRS Tax Topic 409 says "the portion of any unrecaptured section 1250 gain from selling section 1250 real property is taxed at a maximum 25% rate." Unrecaptured section 1250 gain is, for most former homes, the depreciation you took on the building.
- The forms. In Publication 523's example, the depreciation is reported on Form 4797. If you receive a Form 1099-S from the title company, the publication says to report the sale on Form 8949.
Topic 409 also notes that individuals with significant investment income may owe the net investment income tax. Whether it applies to you depends on your income and the rest of your return.
A worked example from IRS Publication 523
The IRS's own example shows the whole sequence: live there, move out, rent, sell, exclude the gain, pay tax on the depreciation. These are Publication 523's figures, summarized.
| Step | Taylor's facts (Publication 523, 2025) |
|---|---|
| Bought and moved in | January 1, 2020, for $400,000, used as principal residence |
| Moved out and started renting | January 1, 2023 |
| Sold | December 1, 2024, for $600,000 |
| Depreciation claimed while rented | $27,000 |
| Total gain | $227,000 ($600,000 minus the $373,000 adjusted basis) |
| Nonqualified use | None, because the rental came after the last date Taylor lived there |
| Taxable part | $27,000 of depreciation, reported on Form 4797 |
| Excludable part | $200,000, within the $250,000 limit |
Notice the timing. Taylor lived there three years, rented for just under two, and sold well inside the window. The same publication walks through a second owner, Cartier, who moved out on January 1, 2021, rented until selling on April 30, 2023, and reaches the same conclusion: no nonqualified use, the exclusion applies, and the depreciation for the rental period cannot be excluded.
The tax years in between: losses and the conversion year
While you rent, the home is reported as rental property, and two rules decide how much of the cost you can deduct.
The conversion year is split. Publication 527 says that if you convert "at any time other than the beginning of your tax year," you "must divide yearly expenses, such as taxes and insurance, between rental use and personal use." You can deduct only the part tied to the rental period, and you "can't deduct depreciation or insurance for the part of the year the property was held for personal use."
Rental losses are passive, with a limited allowance. Publication 527 describes a special allowance of up to $25,000 for owners who actively participate. If your modified adjusted gross income is $100,000 or less, you can use the full allowance. Above $100,000 it shrinks, and "generally, if your MAGI is $150,000 or more," there is no special allowance. Losses you cannot use carry forward under the passive activity rules; a tax professional will track them.
For a San Antonio rental, property tax is one of the largest lines on that Schedule E, and it can rise once the homestead exemption comes off. Our San Antonio property taxes and break-even rent guide walks through the Bexar County rates and what they do to your monthly math.
JBSA and the military suspension rule
Service members on qualified official extended duty can elect to pause the 5-year clock. In a city built around Joint Base San Antonio, this is the rule that most often changes the answer.
Section 121(d)(9)(A) lets an individual elect to suspend the running of the 5-year period while they or their spouse serve on qualified official extended duty as a member of the uniformed services, a member of the Foreign Service, or an employee of the intelligence community. Section 121(d)(9)(C) defines that duty as service at a duty station "at least 50 miles from such property" or "while residing under Government orders in Government quarters." Under (d)(9)(B), the suspension cannot extend the 5-year period by more than 10 years.
If PCS orders moved you away from Lackland, Randolph or Fort Sam Houston and you kept the house, ask your tax professional whether the election fits your dates. It can turn a three-year window into a much longer one. Our guide to renting to military tenants in San Antonio covers the other side of the JBSA market: your future tenant may be on orders too.
Why San Antonio owners are asking this now
Because more San Antonio homes are being rented after failing to sell than in most of the country. Zillow Research data through October 2025, reported by MBA Newslink on March 17, 2026, found that 3.9% of San Antonio rental listings were homes recently listed for sale, against 2.3% across Zillow's rental platform. San Antonio was fourth among the metros named, behind Denver, Houston and Austin.
An accidental landlord is a homeowner who rents out a home they did not buy as an investment, most often because it did not sell at a price they could accept. Almost every accidental landlord is also, without realizing it, now on a 2-out-of-5-year clock. The question is not just "can I rent it" but "how long can I rent it before selling costs me the exclusion."
Two numbers decide whether renting is worth it while that clock runs: what the home will rent for, and what it costs to hold. Our average rent in San Antonio report covers the first. The break-even guide linked above covers the second. If you are still deciding, the accidental landlord hub lays out the rent-or-sell decision step by step, and how to become a landlord in Texas covers the homestead, insurance and Property Code steps in order. Once you have a tenant, the lease itself is governed by Texas Property Code Chapter 92; our Chapter 92 landlord guide is the place to start.
What Flat Fee Landlord does in week one
In the first week, the work is getting the home priced, rent-ready and in front of tenants, with a lease length that fits your sale deadline. With Tenant Placement + Management, the first steps look like this:
- Your deadline goes on the file. Tell us your move-out date and the latest date your tax professional says you can close. We will not suggest a lease term that runs past it without saying so.
- Pricing. We set a recommended rent range from comparable San Antonio-area leases, not from what the mortgage needs. If the comps say your number is high, we tell you.
- Readiness. A home that was just on the sale market is usually close to rent-ready. We walk through what is left.
- Listing, showings and screening. Professional photos, the MLS and the major rental sites, coordinated showings, then screening through the Perfect 10ant System™, our 10-point process: identity, income, employment, credit, rental history, previous landlord references, criminal background, sex offender registry, bankruptcy and foreclosure history. Screening supports a placement decision; it does not guarantee future rent payments or eliminate every risk.
The 21-day placement promise is an application milestone, and it reads exactly like this:
With Tenant Placement + Management, if no completed application is generated within 21 days of the home being rent-ready and listed, we waive the first two months of management fees. This is an application milestone, not a guaranteed lease-signing or move-in date. Owner restrictions, pricing outside our recommended range, access or readiness delays, and events beyond our control are excluded. It does not apply to Tenant Placement Only or Management Only.
Why a flat fee fits an owner on a clock: your management cost shouldn't rise just because rent did. Our management starts at $139/mo: $139 (Basic) / $179 (Preferred) / $349 (Concierge), annual billing. When you are holding a home for a defined window before selling, a fixed management line keeps the rent-versus-sell math honest. See our San Antonio property management cost guide for the full fee picture.
If you want to know what your house would rent for before you talk to your CPA, start with a free rental analysis built from comparable San Antonio leases. For exact pricing on your property, use our quote builder.
Frequently asked questions
The questions below cover what owners ask most often about renting a former home and selling later. Answers are general information, not tax advice.
Sources and last reviewed
Last reviewed October 23, 2026. Every source below was fetched and read on that date. IRS publications cited are the 2025 editions, for use in preparing 2025 returns.
- 26 U.S.C. §121, Exclusion of gain from sale of principal residence, Legal Information Institute, Cornell Law School: subsections (a), (b)(1)–(3), (b)(5), (d)(6) and (d)(9)
- IRS Publication 523 (2025), Selling Your Home, including the nonqualified use exceptions and the Taylor and Cartier examples
- IRS Publication 527 (2025), Residential Rental Property: conversion basis, 27.5-year recovery, placed-in-service rule, conversion-year expense split and the $25,000 special allowance
- IRS Tax Topic 409, Capital gains and losses: 25% maximum rate on unrecaptured section 1250 gain
- MBA Newslink, "Zillow: Accidental Landlords on the Rise," March 17, 2026, summarizing Zillow Research data through October 2025
2,000+
Tenants Placed
<1%
Eviction Rate
9–12 Mo
Tenant Guarantee
4.6★
Google Rating
Our Services

Flat Fee Landlord Team
Flat Fee Landlord
The Flat Fee Landlord team helps landlords across Texas and the DMV find great tenants, stay legally protected, and maximize rental income — for one flat monthly fee.
Frequently Asked Questions
What is the 2-out-of-5-year rule?▾
It is the test in Internal Revenue Code Section 121 for excluding gain when you sell your home. If you owned the home and used it as your principal residence for periods adding up to at least 2 years during the 5 years ending on the date of sale, you can exclude up to $250,000 of gain, or up to $500,000 on a joint return when the joint-return conditions are met. The 2 years do not have to be continuous.
If I rent out my house, do I lose the capital gains exclusion?▾
Not right away. Renting the home after you move out does not cancel the exclusion, and under Section 121(b)(5)(C)(ii)(I) the rental period after your last day of residence is not treated as nonqualified use. What runs out is the window: once your 24 months of residence fall outside the 5 years before the sale, you no longer pass the use test.
How long can I rent out my house and still use the exclusion?▾
If your residence ran right up to the day you moved out, you generally have up to 3 years after moving out to close the sale, because the 5-year look-back still has to contain 24 months of residence. Exact day counts matter, so confirm your dates with a tax professional before you sign a long lease.
Do I pay tax on depreciation when I sell my former home?▾
Yes. Section 121(d)(6) says the exclusion does not cover gain equal to depreciation attributable to periods after May 6, 1997. IRS Publication 523 adds that this includes depreciation allowed or allowable, meaning depreciation you could have claimed even if you did not. IRS Tax Topic 409 says unrecaptured section 1250 gain is taxed at a maximum 25% rate.
What is my depreciation basis when I convert my home to a rental?▾
IRS Publication 527 says the basis for depreciation is the lesser of your adjusted basis or the fair market value on the date you change the home to rental use. Land is not depreciable, and residential rental property is depreciated over 27.5 years using the straight line method and a mid-month convention.
Can military owners stationed away from San Antonio extend the 5-year window?▾
Possibly. Section 121(d)(9) lets a member of the uniformed services, the Foreign Service or the intelligence community elect to suspend the 5-year period while they or their spouse serve on qualified official extended duty, defined as duty at a station at least 50 miles from the property or residing under government orders in government quarters. The suspension cannot extend the period by more than 10 years.
Is this tax advice?▾
No. This guide is general information drawn from the Internal Revenue Code and IRS publications for 2025 returns. Your exact dates, basis and filing status decide the answer, so have a CPA or enrolled agent run your numbers before you choose a sale date or a lease length.
You might also like
- How to Become a Landlord in Texas: The First-Timer's SequenceSeptember 24, 2026How to become a landlord in Texas, in order: taxes and insurance first, then the locks, smoke alarms…
- San Antonio Property Taxes and Your Rental's Break-Even Rent (2026)October 2, 2026A San Antonio rental pays about 2.24% to 2.44% of its value in property tax each year with no homest…
- Tax Deductions for Landlords: A Complete 2026 Guide for Rental Property OwnersJanuary 1, 2025Most landlords leave money on the table at tax time. This guide covers every major deduction availab…
Free Instant Rent Estimate
What could your property rent for?
Enter your address — see an instant comps-based rent estimate.
- ⭐ 4.6 stars · 710+ Google reviews
- ✅ 2,000+ tenants placed
- ✅ <1% eviction rate
- ✅ Tenant assurance on eligible bundles
