IRS Publication 523 — Selling Your Home
This is the passage the answer relied on, shown in the document's own words. The highlighted text is the exact excerpt quoted — extracted verbatim by the citation system, so it cannot be fabricated.
Open official source at page 12 ↗
Space separate from the living area. You generally can’t exclude gain on the separate portion of your property used for business or to produce rental income. Regulations section 1. 121-1(e) provides that the use of a separate portion of your home for business or rental purposes doesn’t qualify for exclusion under section 121, and this may affect your gain or loss calculations. See Regulations section 1.121-1(e). Examples are:
• A working farm on which your house was located,
• A duplex in which you lived in one unit and rented the other, or
• A store building with an upstairs apartment in which you lived.
You can’t exclude gain on the separate part of your property used for business or to produce rental income unless you owned and lived in that part of your property for at least 2 years during the 5 -year period ending on the date of the sale. If you don’t meet the use test for the separate business or rental part of the property, an allocation of the gain on the sale is required. For this purpose, you must allocate the basis of the property and the amount realized between the residential and nonresidential portions of the property using the same method of allocation that you used to determine depreciation adjustments. See the Example for allocating residential and nonresidential portions of the property. Report the sale of the business or rental part on Form 4797. For more information about using any part of your home for business or as a rental property, see Pub. 587, Business Use of Your Home, and Pub. 527, Residential Rental Property.
Space formerly used as business or rental. Note that space formerly used as business or rental will qualify for exclusion under section 121 if the space was converted to the taxpayer’s principal residence for a total of 2 years or more, as long as the use as the principal residence was within the 5 years leading up to the sale. See Regulations section 1. 121-1(a). However, depreciation deductions claimed during the previous business use must be reported on line 5a of Worksheet 2 and recognized as unrecaptured section 1250 gain. No separate Business worksheet is needed because there are no current business expenses. See Regulations section 1. 121-1(d). See also the Instructions for Form 4797, and the Instructions for Schedule D (Form 1040). For information on unrecaptured section 1250 gain, see Recapturing Depreciation, later. 12 Publication 523 (2025)
Excerpt shown from a longer document — use the official source button above to read the complete publication.