When you sell your principal residence, you can exclude from income up to $250,000 of gain and $500,000 on a joint return. Ownership and use tests must be met. But if you’ve been taking a home-office deduction because you used part of your home for business, the IRS will consider part of the house sale as a sale of business property. That means you’ll have to pay taxes on the portion of the gain which is allocated to the part of the house you used for business.
You can avoid this problem if no part of your house qualifies for a home-office deduction during the year the sale is made. If you make sure that it’s obvious that your home office space is used for non-business purposes, it won’t qualify for the home-office deduction. The sale will not be treated as a partial sale of business property and 100% of the sales proceeds will qualify for deferral of taxes on the gain.