When calculating earnings for Social Security purposes, you can exclude gains or losses from the disposition of certain properties if you do any of the following:
Sell or exchange a capital asset, except in the course of business of an options or commodities dealer;
Cut timber or dispose of timber, coal or iron ore, even though held primarily for sale to customers, if section 631 of the Internal Revenue Code applies; or
Sell, exchange, involuntarily convert or make other disposition of property that is not:
Stock in trade or other property of a kind that would be included in inventory if it was on hand at the close of the taxable year; or
Property held primarily for sale to customers in the ordinary course of business.