Investing Strategies

Do I pay capital gains if I sell my house after renting it out during a PCS?

Do I pay capital gains if I sell my house after renting it out during a PCS?

Maybe. 26 U.S.C. 121(a) says gross income shall not include gain from the sale of property if, during the 5-year period ending on the date of the sale, you owned the property and used it as your principal residence for periods aggregating 2 years or more. Renting the house after you leave does not, by itself, wipe out ownership and use you already built up.

Two limits still sit on top of that sentence. 26 U.S.C. 121(d)(6) says the exclusion does not apply to gain up to the depreciation adjustments attributable to periods after May 6, 1997. 26 U.S.C. 121(b)(5) says the exclusion does not apply to gain allocated to periods of nonqualified use. If you or your spouse is serving on qualified official extended duty, 26 U.S.C. 121(d)(9) lets you elect to suspend the running of that 5-year period, and it says the period shall not be extended more than 10 years because of that suspension. IRS Publication 523, Selling Your Home, walks through the same tests.

That is the shape of the rule. It is not your tax bill, and it is not a promise that the gain is tax free. Talk with a tax professional before you sell or file. The dates on the deed, the orders, and the depreciation schedule are what get applied.

A member named Titus asked the ADPI campus a question that shows up every PCS season. Keep the VA-financed house and try to rent it, or sell and buy again at the next duty station? His post was the decision, not a tax return. It does not say he sold, rented, or owed or avoided any tax. The loan side of keeping the house is on Can I rent out my VA loan house when I PCS?. This page is the tax side, for when a house that was a home, and then a rental, is the one you sell.

The 2-of-5 ownership and use test

26 U.S.C. 121(a) requires both ownership and use. During the 5-year period ending on the date of the sale or exchange, the property has to have been owned and used by the taxpayer as the taxpayer's principal residence for periods aggregating 2 years or more.

Publication 523 splits that into steps. You meet the ownership test if you owned the home for at least 24 months (2 years) out of the last 5 years leading up to the date of sale, which the publication treats as the closing date. For a married couple filing jointly, only one spouse has to meet the ownership requirement.

You meet the residence test if you owned the home and used it as your residence for at least 24 months of the previous 5 years. Publication 523 says those 24 months can fall anywhere within the 5-year period. They do not have to be a single block of time. All that is required is a total of 24 months (730 days) of residence during the 5-year period. Unlike ownership, each spouse must meet the residence requirement individually for a married couple filing jointly to get the full exclusion.

A vacation or other short absence counts as time you lived at home, even if you rented the home while you were gone. That sentence in Publication 523 is about a short absence. It is not a rule that a multi-year rental counts as residence.

There is also a look-back. 26 U.S.C. 121(b)(3) says the exclusion shall not apply to a sale if, during the 2-year period ending on the date of that sale, there was any other sale by the taxpayer to which the exclusion applied. Publication 523 calls this Eligibility Step 4. You may take the exclusion only once during a 2-year period.

On a joint return, 26 U.S.C. 121(d)(1) says subsections (a) and (c) apply if either spouse meets the ownership and use requirements. That is who can use the section. It is not the same sentence as the larger dollar cap, which is below.

In the ADPI book Military House Hacking, Eric Upchurch describes buying a home with a VA loan, living there more than two years, and then seeing that the home had appreciated. He writes that because they had owned it more than two years, a sale at that point would mean no tax on net gains under the primary-residence exclusion, as he understood it. His point is that the VA loan got him into a market he could not otherwise enter, and that how long he had owned the home mattered for the tax treatment he had in mind.

That is Eric's account of a home he had lived in. It is not a sale of a house he had rented for years after a PCS. "No tax on any net gains" is his reading, not this page's advice. The tests in section 121(a) and Publication 523 still have to be met, including use, the look-back, and the limits for depreciation and nonqualified use if they apply. This story does not illustrate the military suspension or depreciation.

In a book interview conducted by Markian Sich, Nico Gibbs says he sold his first house about a year before the interview, that it sold in forty days, and that he did not pay capital gains because he had lived in it for two years. He is describing a sale of a home he had lived in, not a home he had turned into a rental after orders. Living there for two years is one part of the residence test. His account does not walk through ownership, the look-back, the dollar cap, or depreciation. His result is his experience of that sale. It is not a rule that two years of living there ends the tax question.

The dollar cap, and the conditions on it

26 U.S.C. 121(b)(1) says the amount of gain excluded under subsection (a) shall not exceed $250,000.

For a husband and wife who file a joint return for the year of the sale, section 121(b)(2) substitutes $500,000 for $250,000 only when three things are true: either spouse meets the ownership requirement, both spouses meet the use requirement, and neither spouse is ineligible because of the once-every-two-years rule in paragraph (b)(3). If the couple does not meet those three conditions, the limitation is the sum of the limitations each spouse would have if they had not been married. For that sum, each spouse is treated as owning the property during the period either spouse owned it.

Publication 523 states the ownership and residence split the same way: on a joint return, one spouse can meet ownership, and each spouse must meet the residence test to get the full exclusion. The $500,000 conditions and the sum-of-the-two-limits fallback are in section 121(b)(2). Publication 523 tells you to use its worksheets to figure taxable gain. Do not treat $250,000 or $500,000 as the tax on your closing statement. They are caps on what subsection (a) can exclude, and only after the ownership, use, and look-back rules are applied. Depreciation and nonqualified use, covered below, come out of the exclusion even when the cap would otherwise fit.

How the suspension can extend the lookback

26 U.S.C. 121(d)(9) is titled "Uniformed services, Foreign Service, and intelligence community." At the election of an individual with respect to a property, the running of the 5-year period described in subsections (a) and (c)(1)(B), and in paragraph (d)(7), is suspended during any period that the individual or the individual's spouse is serving on qualified official extended duty:

  • as a member of the uniformed services,
  • as a member of the Foreign Service of the United States, or
  • as an employee of the intelligence community.

Section 121(d)(9)(B) says the 5-year period described in subsection (a) shall not be extended more than 10 years by reason of that suspension.

Publication 523 describes the same choice for a member of the Uniformed Services or the Foreign Service, an employee of the intelligence community, or a Peace Corps employee, enrolled volunteer, or volunteer leader. The publication says you may choose to suspend the 5-year test period for ownership and residence when you are on qualified official extended duty. That means you may be able to meet the 2-year residence test even if, because of your service, you did not actually live in the home for at least 2 years during the 5-year period ending on the date of sale.

Publication 523 says the period of suspension cannot last more than 10 years. Together, the 10-year suspension period and the 5-year test period can be as long as, but no more than, 15 years. You cannot suspend the 5-year period for more than one property at a time. You can revoke your choice at any time. The statute says the same thing about one property and about revocation: an election for one property may not be made if an election is in effect for any other property, and an election may be revoked at any time.

You make the election by filing the tax return for the year of the sale or exchange of your main home, and by excluding the gain from taxable income. That is Publication 523's instruction for how the choice is claimed. It is not a form number this page invents.

Publication 523's second example is a service member on extended duty, and it does not describe a rental. You bought and moved into a home in 2016. You lived in it as your main home for 3 and a half years. For the next 6 years you did not live in it because you were on qualified official extended duty with the Army. You sold the home at a gain in 2025. To meet the use test, you choose to suspend the 5-year test period for those 6 years. You can disregard those 6 years. Your 5-year test period is the 5 years before you went on that duty. You meet the ownership and use tests because you owned and lived in the home for 3 and a half years during this test period.

That example shows how the suspension moves the lookback. It does not say the house was rented, and it does not compute a tax. If the house was a rental during the duty, the depreciation and nonqualified-use sections below are separate.

The statute points "uniformed services" to the meaning in section 101(a)(5) of title 10, United States Code, as in effect on the date this paragraph was enacted. Publication 523 lists, for this suspension, a member of the armed forces (Army, Navy, Air Force, Marine Corps, Space Force, Coast Guard), and a member of the commissioned corps of the National Oceanic and Atmospheric Administration or the Public Health Service. The same publication list also includes specified Foreign Service, Peace Corps, and intelligence community roles. Read the list in Publication 523 rather than guessing from a job title.

The distance and the orders

26 U.S.C. 121(d)(9)(C) defines the terms.

Qualified official extended duty means any extended duty while serving at a duty station which is at least 50 miles from such property, or while residing under Government orders in Government quarters.

Extended duty means any period of active duty pursuant to a call or order to such duty for a period in excess of 90 days, or for an indefinite period.

Publication 523 states those conditions as what it means to be on qualified extended duty: you are called or ordered to active duty for an indefinite period, or for a definite period of more than 90 days, and you are serving at a duty station at least 50 miles from your main home, or you are living in government quarters under government orders.

Both parts are in the definition. A set of orders that is 90 days or less, and is not for an indefinite period, is not "extended duty" under that sentence. A duty station closer than 50 miles does not meet the distance clause, unless you are residing under Government orders in Government quarters. The statute measures the 50 miles from the property ("such property"), which Publication 523 calls your main home. It does not say "50 miles farther than your old job." That different 50-mile test belongs to the reduced exclusion below.

The statute does not use the words "PCS orders." Whether a particular set of orders meets the call-or-order test, the length test, and the distance or government-quarters test is a reading of those orders against the statute. This page does not make that reading for you.

Depreciation taken on the rental is not excluded

26 U.S.C. 121(d)(6) says subsection (a) shall not apply to so much of the gain from the sale of any property as does not exceed the portion of the depreciation adjustments (as defined in section 1250(b)(3)) attributable to periods after May 6, 1997, in respect of such property.

Publication 523, under Recapturing Depreciation, says that if you were entitled to take depreciation deductions because you used your home for business purposes or as rental property, you cannot exclude the part of your gain equal to any depreciation allowed or allowable as a deduction for periods after May 6, 1997. Later, under "Determine any depreciation amounts you may need to recapture," the publication says the exclusion of gain does not apply to any gain from depreciation adjustments attributable to periods after May 6, 1997. If you did not deduct any depreciation, you decrease your basis by the amount you could have deducted.

Publication 523's example of a homeowner who lived in the house, moved to another state, rented it, and then sold it says the owner cannot exclude the part of the gain equal to the depreciation claimed or that could have been claimed for renting the house. The publication's Taylor example, a residence converted to a rental and then sold, calls that depreciation portion unrecaptured section 1250 gain. This page uses those names for the rule. It does not reprint the dollar worksheets.

Section 1250 also has a separate rule for additional depreciation in excess of straight-line, which Publication 523 points to Publication 544. This page does not restate a tax rate. The point section 121(d)(6) and Publication 523 support is narrower and exact: that depreciation piece is not excluded under section 121.

Section 121(b)(5)(D) coordinates the two limits. The nonqualified-use rule is applied after subsection (d)(6). The nonqualified-use ratio is applied without regard to any gain to which (d)(6) applies. Depreciation comes out first. It is not folded into the nonqualified-use fraction and then excluded.

Nonqualified use, and the exception for qualified official extended duty

26 U.S.C. 121(b)(5)(A) says subsection (a) shall not apply to so much of the gain as is allocated to periods of nonqualified use.

The allocation is a ratio. Gain is allocated to periods of nonqualified use based on the ratio of the aggregate periods of nonqualified use during the period the taxpayer owned the property, to the period the taxpayer owned the property. That is section 121(b)(5)(B).

Section 121(b)(5)(C) defines a period of nonqualified use as any period (other than the portion of any period preceding January 1, 2009) during which the property is not used as the principal residence of the taxpayer or the taxpayer's spouse or former spouse.

The same paragraph says the term does not include three kinds of time:

  1. 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.
  2. Any period (not to exceed an aggregate period of 10 years) during which the taxpayer or the taxpayer's spouse is serving on qualified official extended duty, as defined in subsection (d)(9)(C), described in clause (i), (ii), or (iii) of subsection (d)(9)(A). Those clauses are uniformed services, Foreign Service, and intelligence community employee.
  3. Any other period of temporary absence (not to exceed an aggregate period of 2 years) due to change of employment, health conditions, or such other unforeseen circumstances as may be specified by the Secretary.

Publication 523 states the same three exceptions. It says nonqualified use means any period after 2008 when neither you nor your spouse (or former spouse) used the property as your main home, with certain exceptions. A period of nonqualified use does not include any portion of the 5-year period ending on the date of the sale or exchange after the last date you or your spouse (or former spouse) used the property as your main home. It does not include any period (not to exceed 10 years) during which you or your spouse are serving on qualified official extended duty in the roles the publication lists. And it does not include any other period of temporary absence (not to exceed an aggregate period of 2 years) due to change of employment, health conditions, or other unforeseen circumstances as may be specified by the IRS.

Publication 523's Worksheet 3 note says you may skip the nonqualified-use section of that worksheet if the period of nonuse was for 10 years or less and was due to the "stop the clock" exception for certain military, intelligence, and Peace Corps personnel described in the publication's service section. That note is about the worksheet. It does not replace the statutory 10-year aggregate cap.

The first exception and the duty exception do different work. The first one is about time after the last date of principal-residence use, and only the portion of the 5-year period described in subsection (a). The duty exception is any period of qualified official extended duty, up to 10 years in total, and it uses the definition in section 121(d)(9)(C). Publication 523's Cartier example is about the first exception, and the publication does not describe Cartier as a service member. Cartier owned and used a house as a main home from 2017 through 2020, moved to another state on January 1, 2021, rented the home from that date until selling it on April 30, 2023, and during the 5-year period ending on the sale had owned and lived in the house for more than 2 years. Publication 523 says there is no period of nonqualified use, because the period of nonqualified use does not include any part of the 5-year period after the last date Cartier lived in the home. It also says Cartier still cannot exclude the part of the gain equal to the depreciation Cartier claimed or could have claimed for renting the house.

Read that example as the publication's illustration of the post-residence exception plus the depreciation limit. It is not a member's PCS, and it is not a statement that every rental after a move is outside nonqualified use. If the rental years do not fall inside the 5-year period the statute describes, this exception does not say they are covered. The duty exception is the separate sentence, and it has its own 10-year aggregate cap.

A sale before 2 years is a different rule

People also ask whether a sale in less than 2 years can exclude any gain. 26 U.S.C. 121(c) is the reduced exclusion. It applies when subsection (a) would not apply because you failed the ownership and use requirements, or because of the once-every-two-years rule, and the sale is by reason of a change in place of employment, health, or, to the extent provided in regulations, unforeseen circumstances. The ownership and use requirements, and the once-every-two-years bar, do not apply. The dollar limitation is prorated. The statute's fraction uses the shorter of the time you owned and used the home as a principal residence during the 5-year period, or the time since the most recent prior excluded sale, over 2 years.

Publication 523 describes a work-related move that meets this reduced exclusion when you took or were transferred to a new job in a work location at least 50 miles farther from the home than your old work location, or you had no previous work location and began a new job at least 50 miles from the home. That is a different 50-mile test from section 121(d)(9). The military suspension pauses the 5-year clock during qualified official extended duty. The reduced exclusion shrinks the dollar cap when you sell without meeting the 2-year tests because of a qualifying move. Do not treat one as the other.

One more bar, if the house came through a like-kind exchange. 26 U.S.C. 121(d)(10) says that if you acquired the property in an exchange on which gain was not recognized in whole or in part under section 1031, subsection (a) shall not apply to a sale of that property during the 5-year period beginning on the date of that acquisition.

What to take to a tax professional

Bring the closing dates, the periods you actually lived in the home, the orders (length, and whether the duty station was at least 50 miles from the property or you lived in government quarters under orders), any election you plan to make under section 121(d)(9), and the depreciation allowed or allowable after May 6, 1997. Publication 523 is the worksheet source. The statute is the rule. Neither one is a filled-in return.

A wider article on this site, Navigating capital gains tax on real estate, talks about gains in general. The ownership test, the suspension, depreciation, and nonqualified use on this page are the rules in section 121 and Publication 523.

Why ADPI covers the tax side

ADPI was founded in 2017 by military veterans to teach real estate to the military community. For many service members, the first rental is a house they lived in and kept after a PCS, and the sale is where the rules on this page land. Under the tax question there is usually a bigger one: sell and move on, or keep the house and buy the next one with the VA loan?

ADPI does not give tax advice. What we teach is the residential path: buying with the benefit you earned, keeping what you leave behind as a rental, and doing it again at the next duty station. Residential Pro is our step-by-step program for it. If you are deciding whether to sell or keep building, book a call with our team. Take the tax numbers to a tax professional first, and bring us the plan.

Questions service members ask

Do I pay capital gains tax if I sell after renting during a PCS?

Not as a yes or no. Section 121(a) excludes gain when you owned the home and used it as your principal residence for 2 years or more during the 5-year period ending on the sale. Renting it after a move does not remove that history by itself. Depreciation adjustments after May 6, 1997 are not excluded, and gain allocated to nonqualified use is not excluded. A tax professional has to apply your dates.

What is the 2-year ownership and use test?

IRS Publication 523 says you meet the ownership test if you owned the home for at least 24 months of the 5 years leading up to the closing date. You meet the residence test if you owned it and used it as your residence for at least 24 months of those 5 years. Those months of residence can fall anywhere in the 5-year period and do not have to be one block of time. On a joint return, only one spouse has to meet ownership. Each spouse has to meet the residence test for the couple to get the full exclusion.

How large is the exclusion, and what has to be true first?

Section 121(b)(1) says the excluded gain shall not exceed $250,000. On a joint return that figure becomes $500,000 only if one spouse meets the ownership test, both spouses meet the use test, and neither spouse is barred by the once-every-two-years rule. If those three conditions are not met, the limit is the sum of what each spouse would have if unmarried. Depreciation and nonqualified-use gain are not part of the excluded amount. This is the statutory cap, not a computation of your sale.

Can service suspend the 5-year period?

Yes, by election, and only on the conditions in section 121(d)(9). At your election, the running of the 5-year period is suspended while you or your spouse serve on qualified official extended duty as a member of the uniformed services. The statute says that suspension shall not extend the 5-year period more than 10 years. Publication 523 says the suspension and the 5-year test together can be as long as, but no more than, 15 years. You claim it on the return for the year of the sale. The election can cover only one property at a time, and you can revoke it.

What distance and what orders count?

Section 121(d)(9) defines qualified official extended duty as extended duty while serving at a duty station at least 50 miles from the property, or while residing under Government orders in Government quarters. Extended duty means active duty under a call or order for more than 90 days, or for an indefinite period. Publication 523 states those same conditions. The statute does not use the words PCS orders.

Is depreciation from the rental excluded?

No. Section 121(d)(6) says the exclusion does not apply to gain up to the depreciation adjustments attributable to periods after May 6, 1997. Publication 523 says you cannot exclude the part of the gain equal to any depreciation allowed or allowable after that date, and its examples call that amount unrecaptured section 1250 gain. If you did not deduct depreciation, Publication 523 says to reduce your basis by the amount you could have deducted.

Is renting the house after I moved out nonqualified use?

Not in every case. Section 121(b)(5) says the exclusion does not apply to gain allocated to periods of nonqualified use, and it lists exceptions. One exception is the portion of the 5-year period that falls after the last date you or your spouse used the property as a principal residence. Another is a period of qualified official extended duty, not more than 10 years in total. Publication 523 states the same exceptions. Your calendar has to be checked against them. That check is for a tax professional.

What if I have to sell before 2 years?

That is a different rule from the military suspension. Section 121(c) can reduce the dollar cap when the sale is because of a change in place of employment, health, or unforeseen circumstances to the extent regulations provide, and you fail the ownership and use tests or the once-every-two-years rule. Publication 523 describes a work move for this reduced exclusion when the new job is at least 50 miles farther from the home than the old work location. That 50-mile test is not the qualified official extended duty test in section 121(d)(9).