The answer to this question really depends on the type of legal entity your business is operated through. Businesses may be operated as any of the following:

Each legal entity has unique tax advantages and disadvantages, depending upon the nature of the business. Let's answer this question, legal entity by legal entity.

C Corporation

There would be no long-term capital gains tax on the sale, but there would be regular corporate income tax if a profit is realized on the house. The reason: C corporations do not have any preferential capital gains tax rates available to them. Generally, all of the income recognized by a business operating through a traditional C corporation is taxed at the corporate income tax rate – a flat 21%, as of 2018. Any asset sale by a corporation to a shareholder would be taxed if there were a gain on the sale, including a house.

Furthermore, the sales price must represent what is called an arm's length price, meaning it represents what an independent third party would pay for the home. No charging yourself $100 for a 25,000 square-foot residence with swimming pool and three-car garage, in other words If the sales price of the home was determined to be not at arm's length by the IRS, then there are a host of distribution-related issues that could apply.

S Corporation

The sale of a house by an S corporation to one of its shareholders would be treated as a long-term capital gain (if the corporation owned the house for more than one year). An S corporation generally does not pay any income tax; all items of income and loss are passed through to the individual shareholders. So, this gain would be passed through to the respective shareholder and who must report it on his or her individual income tax return.  here are other issues, such as depreciation recapture if the house were used for a business purpose.

Single-Member LLC and Sole Proprietorship

Single-member LLCs and sole proprietorships are taxed the same way at the federal level. If the house were used for business purposes and was owned by an LLC (that is, the title was in the name of the LLC) then the gain on the sale would have to be reported by the owner of the LLC on his or her individual income tax return. If the house were owned more than one year by the LLC, then the owner would treat the gain as a long-term capital gain.

With respect to a sole proprietorship, the house can only be titled in the name of the individual who operated the sole proprietorship. Since title does not change, there is no sale and no capital gains issue until the individual sells the house to an independent third party. Depreciation recapture rules would apply if the house were used by the business whether an LLC or sole proprietorship.

LLC with Multiple Owners, Taxed as a Corporation

The rules that apply to a corporation would be identical in this scenario, meaning any long-term capital gain would be taxed only within the LLC.

LLC with Multiple Owners, Taxed as a Partnership and General Partnership

Partnerships are similar to S corporations in that the individual items of income and loss are not taxed within the partnership, but are passed through to the individual partners and taxed on their individual income tax returns. Thus, any sale of a house by the partnership would be taxable to the individual partners, and not the partnership. If the partnership owned the house for more than one year, then the gain would be eligible for the long-term capital gains tax rate, which is currently 15%.

The Bottom Line

The real troublesome issue with respect to a house owned by a business is the loss of the home sale exclusion. This provision allows homeowners who sell their primary residence to exclude much the gain from taxation ($250,000 if single; $500,000 if married filing jointly). When the house is owned by a business this home sale exclusion is lost, as in any tax transaction, it goes without saying that individuals need to seek the advice of a CPA or tax attorney.