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.
In Canada, capital gains or losses are realized only when assets (such as stocks, bonds, precious metals, real estate, or other property) are sold or deemed to be sold and are subject to capital gains tax.
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.
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.
The tax doesn't apply to unsold investments or unrealized capital gains. Stock shares won't incur taxes until they're sold no matter how long the shares are held or how much they increase in value.
An asset sale occurs when a business sells all or a portion of its assets. The seller, or target company, in this type of deal, is still legally the owner of the company, but no longer owns the assets sold. In a stock sale, the buyer acquires equity from the target company's shareholders.