Two options -if S-corporation has no Earnings and Profits during tax year or had Earnings and/or Profits.
No Earnings and Profits - distributions are applied against basis of the shareholder's share - the amount in excess of the basis is treated as gain from the sale or exchange of property.
With Earnings and Profits - the portion of the distribution not to exceed the accumulated adjustments account (AAA) is treated the same as the S Corporation having no earnings and profits - see above. The portion of the distribution in exceed of the AAA up to the amount of the accumulated earnings and profits is treated as dividends. And the rest is treated the same as the S Corporation having no earnings and profits
See for reference - http://www.law.cornell.edu/uscode/uscode26/usc_sec_26_00001368----000-.html
Tax Preparer
Personal Investment, Tax Preparation