skip navigation
Search Help
Navigation Help

Tax Map Index

Tax Topic Index

Affordable Care Act
Tax Topic Index

Exempt Organization
Tax Topic Index

Tax Topics

About Tax Map Website
Publication 17

Business Use or Rental of Home(p115)

You may be able to exclude gain from the sale of a home you have used for business or to produce rental income. But you must meet the ownership and use tests.

Periods of nonqualified use.(p115)

In most cases, gain from the sale or exchange of your main home won’t qualify for the exclusion to the extent that the gains are allocated to periods of nonqualified use. Nonqualified use is any period after 2008 during which neither you nor your spouse (or your former spouse) used the property as a main home with the following exceptions.


A period of nonqualified use doesn’t include:
  1. Any portion of the 5-year period ending on the date of the sale or exchange after the last date you (or your spouse) use the property as a main home;
  2. Any period (not to exceed an aggregate period of 10 years) during which you (or your spouse) are serving on qualified official extended duty:
    1. As a member of the uniformed services,
    2. As a member of the Foreign Service of the United States, or
    3. As an employee of the intelligence community; and
  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 IRS.
The gain resulting from the sale of the property is allocated between qualified and nonqualified use periods based on the amount of time the property was held for qualified and nonqualified use. Gain from the sale or exchange of a main home allocable to periods of qualified use will continue to qualify for the exclusion for the sale of your main home. Gain from the sale or exchange of property allocable to nonqualified use won’t qualify for the exclusion.


To figure the portion of the gain allocated to the period of nonqualified use, multiply the gain by the following fraction.
 Total nonqualified use during the period of ownership after 2008
 Total period of ownership 

Example 1.(p116)

On May 24, 2011, Amy, who is single for all years in this example, bought a house. She moved in on that date and lived in it until May 31, 2013, when she moved out of the house and put it up for rent. The house was rented from June 1, 2013, to March 31, 2015. Amy claimed depreciation deductions in 2013 through 2015 totaling $10,000. Amy moved back into the house on April 1, 2015, and lived there until she sold it on January 28, 2017, for a gain of $200,000. During the 5-year period ending on the date of the sale (January 29, 2012–January 28, 2017), Amy owned and lived in the house for more than 2 years as shown in the following table.
Used as
Used as
1/29/12 –
16 months   
6/1/13 –
  22 months
4/1/15 –
21 months  
 37 months22 months
Next, Amy must figure how much of her gain is allocated to nonqualified use and how much is allocated to qualified use. During the period Amy owned the house (2,076 days), her period of nonqualified use was 669 days. Amy divides 669 by 2,076 and obtains a decimal (rounded to at least three decimal places) of 0.322. To figure her gain attributable to the period of nonqualified use, she multiplies $190,000 (the gain not attributable to the $10,000 depreciation deduction) by 0.322. Because the gain attributable to periods of nonqualified use is $61,180, Amy can exclude $128,820 of her gain.
See the worksheet for Taxable Gain on Sale of Home—Completed Example 1 for Amy, later, for how to figure Amy's taxable gain and exclusion.
PencilWorksheet.Taxable Gain on Sale of Home—
Completed Example 1 for Amy
Part 1. Gain or (Loss) on Sale   
1. Selling price of home1. 
2. Selling expenses (including commissions, advertising and legal fees, and seller-paid loan charges)2. 
3. Subtract line 2 from line 1. This is the amount realized3. 
4. Adjusted basis of home sold. See Pub. 5234. 
5. Gain or (loss) on the sale. Subtract line 4 from line 3. If this is a loss, stop here 5.200,000 
Part 2. Exclusion and Taxable Gain   
6. Enter any depreciation allowed or allowable on the property for periods after May 6, 1997. If none, enter -0-6.10,000 
7. Subtract line 6 from line 5. If the result is less than zero, enter -0-7.190,000 
8. Aggregate number of days of nonqualified use after 2008. If none, enter -0-.
If line 8 is equal to zero, skip to line 12 and enter the amount from line 7 on line 12
9. Number of days taxpayer owned the property9.2,076 
10. Divide the amount on line 8 by the amount on line 9. Enter the result as a decimal (rounded to at least 3 places). Don’t enter an amount greater than 1.000 10.0.322 
11. Gain allocated to nonqualified use. (Line 7 multiplied by line 10)11.61,180 
12. Gain eligible for exclusion. Subtract line 11 from line 712.128,820 
13. If you qualify to exclude gain on the sale, enter your maximum exclusion.
If you qualify for a reduced maximum exclusion, enter your reduced maximum exclusion.
If you don’t qualify to exclude gain, enter -0-. See Pub. 523
14. Exclusion. Enter the smaller of line 12 or line 13 14.128,820 
15. Taxable gain. Subtract line 14 from line 5.
If the amount on line 6 is more than zero, complete line 16
16. Enter the smaller of line 6 or line 15. Enter this amount on line 12 of the Unrecaptured Section 1250 Gain
Worksheet in the Instructions for Schedule D (Form 1040)

Example 2.(p116)

William owned and used a house as his main home from 2011 through 2014. On January 1, 2015, he moved to another state. He rented his house from that date until April 29, 2017, when he sold it. During the 5-year period ending on the date of sale (April 30, 2012–April 29, 2017), William owned and lived in the house for more than 2 years. He must report the sale on Form 4797 because it was rental property at the time of sale. Because the period of nonqualified use doesn’t include any part of the 5-year period after the last date William lived in the house, he has no period of nonqualified use. Because he met the ownership and use tests, he can exclude gain up to $250,000. However, he can’t exclude the part of the gain equal to the depreciation he claimed or could have claimed for renting the house, as explained next.

Depreciation after May 6, 1997.(p116)

If you were entitled to take depreciation deductions because you used your home for business purposes or as rental property, you can’t exclude the part of your gain equal to any depreciation allowed or allowable as a deduction for periods after May 6, 1997. If you can show by adequate records or other evidence that the depreciation allowed was less than the amount allowable, then you may limit the amount of gain recognized to the depreciation allowed. See Pub. 544 for more information.

Property used partly for business or rental.(p116)

If you used property partly as a home and partly for business or to produce rental income, see Pub. 523.