https://www.irs.gov/publications/p523?
Sale of your main home.
You may take the exclusion, whether maximum or partial, only on the sale of a home that is your principal residence, meaning your main home. An individual has only one main home at a time. If you own and live in just one home, then that property is your main home. If you own or live in more than one home, then you must apply a "facts and circumstances" test to determine which property is your main home. While the most important factor is where you spend the most time, other factors are relevant as well. They are listed below. The more of these factors that are true of a home, the more likely that it is your main home.
-
The address listed on your:
-
U.S. Postal Service address,
-
Voter Registration Card,
-
Federal and state tax returns, and
-
Driver's license or car registration.
-
-
The home is near:
-
Where you work,
-
Where you bank,
-
The residence of one or more family members, and
-
Recreational clubs or religious organizations of which you are a member.
-
Finally, the exclusion can apply to many different types of housing facilities. A single-family home, a condominium, a cooperative apartment, a mobile home, and a houseboat each may be a main home and therefore qualify for the exclusion.