Hello and thank you for your question.
The following is from
IRS Publication 523
I've used < > to emphasize key parts of the test.
If you use property partly as a home and partly for business or to
produce rental income, the treatment of any gain on the sale depends
partly on whether the business or rental part of the property is part
of your home or separate from it.
You <cannot> 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 do <not> meet the use
test for the business or rental part of the property, you <must>
allocate the basis of the property and the amount realized upon its
sale between the business or rental part and the part used as a home.
You must report the sale of the business or rental part on Form 4797.
In 2000, Lew bought property that consisted of a house and a stable.
He used the house as his main home and used the stable in his business
for the next 4 years. He sold the entire property in 2004 at a $10,000
gain. Lew met the ownership and use tests for the house but did <not>
meet the use test for the stable. Lew must allocate the basis of the
property and the amount realized between the part of the property he
used for his home and the part he used for his business, since the
business part was separate from his home. Lew must report the gain on
the business part of his property on Form 4797. He can exclude the
gain on the part of the property that was his main home.
[On the other hand, you generally can exclude gain on the part of your
property used for business or rental if you owned and lived in that
part as your main home for at least 2 years during the 5-year period
ending on the date of the sale. Example 5 on the cited page shows how
to do this calculation]
I hope this is clear. Basically, if you haven't lived in the
rented-out part for 2 of the last 5 years, you can use the full
250,000/500,000 exclusion to shelter gain allocable to your residence,
but you'll have to pay tax on the gain allocable to the rented-out
part. There are also some tricky depreciation calculations to do in
calculating that gain.
Search terms used:
selling residence site:irs.gov
Google Answers Researcher