The short answer is that a stock sale is better for you, the seller, while the buyer benefits from an asset sale. But, since we're talking about the IRS, there are infinite variations and complications. As such, you will want to get professional tax and legal advice before proceeding.
For the target, a stock sale is usually a nonevent from a tax perspective. The buyer in a stock sale does not get a step-up in tax basis in the assets that comprise the target company, and thus is not able to increase their depreciation and amortization deductions in the same way as in an asset sale.
In an asset sale, the ownership of these acquired assets would change hands, with the buyer negotiating separately for each asset. In a stock sale, ownership of such assets does not change hands in the same way. The target still retains its ownership typically, even if the target has a new owner.
Almost everything you own and use for personal or investment purposes is a capital asset. Examples of capital assets include a home, personal-use items like household furnishings, and stocks or bonds held as investments.
To avoid paying capital gains taxes entirely, one option you may want to discuss with your tax advisor is to give certain appreciated investments away — either to charity or to your beneficiaries as part of your estate plan.
Stocks are financial assets. They're not real assets. A financial asset is a liquid asset that gets its value from a contractual right or ownership claim.
1) Use your CGT allowance The simplest way to avoid capital gains tax is to regularly use your capital gains tax allowance (officially known as your annual exempt amount or AEA). How easy this is to do depends on the assets you are selling.
To correctly arrive at your net capital gain or loss, capital gains and losses are classified as long-term or short-term. Generally, if you hold the asset for more than one year before you dispose of it, your capital gain or loss is long-term. If you hold it one year or less, your capital gain or loss is short-term.