Hello and thank you for your question.
Distributions decrease basis. In the event you have a $0 basis and take a distribution, then you recognize income (capital gain) for the amount of the distribution. Basis remains at $0.
For the technical definition of basis, see IRC 1367 (Internal Revenue Code Section 1367). www.law.cornell.edu/uscode/text/26/1367
In general, increases in basis result from items of income of the S-Corp. Increases in basis also result from shareholder capital contributions and loans to the S-Corp. On the other hand, decreases in basis result from expenses, distributions, and loan repayments to shareholders.
Note, a loan only increases a shareholder's basis in the S-corp if the loan comes from the shareholder. A third party creditor that makes a loan to the S-corp will have no effect on shareholder basis.
Given the above, it should be clear that your basis in the S-corp is a dynamic number. Each year, it is common for shareholders to receive a basis statement from their S-corp along with the schedule K-1, but this is not required and ultimately it is the shareholders' responsibility to track their basis from year to year. Shareholder basis does not appear on the S-corp return or schedule K-1.
A shareholders basis may differ for regular tax purposes and alternative minimum tax purposes. Therefore, you are computing the gain/loss twice should you dispose of the stock: once for regular tax purposes and once for alternative minimum tax purposes.
The gain or loss on the disposal of S-corp stock can result in short term or long term gain depending on how long the stock is held.
Alternatively, the S-corp can sell all of its assets and liabilities without selling the stock. This is called an asset sale as opposed to a stock sale. The seller usually prefers a stock sale while the purchaser prefers an asset sale (primarily because assets can be depreciated resulting in business deductions while stock is not depreciated and no deduction is obtained until the stock is sold or disposed of, though there are many additional factors).
I hope this information is helpful.
Basis is separate of retained earnings right? As our retained earnings is way negative.
I feel like I am paying tax twice on the distributions taken over my basis. Am I? We have paid back all the company debt with the sale proceeds.
Basis and retained earnings are different numbers, correct. Basis in this case is referring to your basis, as defined by the internal revenue code, in your S-corporation shares. Retained earnings is not defined in the internal revenue code and reflects the corporation's retained equity (deficit) in earnings (losses). Retained earnings in the U.S. is generally defined by GAAP (generally accepted accounting principles) as promulgated by the FASB (Financial Accounting Standards Board).
In general, no, the laws prevent you from recognizing gain twice. If you incorrectly calculate your basis in your S-corporation shares then you could inadvertently recognize more gain than you truly should (or loss...). To tell whether or not you specifically are calculating your amounts correctly I would have to review your records, assuming they are adequate, and perform the calculation.
If you have never tracked your basis in your S-corporation, then you may find yourself unable to determine your basis. A true calculation of basis starts with your first purchase of stock in the S-corp and runs through the date you sell it.
Assuming an S-corporation's liabilities would result in a capital contribution, increasing your basis.
Again, I hope this is helpful.