Insider trading has two definitions, one bad and one good.
1.When investors buy or sell based on material non-public information, they are engaged in illegal insider trading. For instance, your cousin is chief financial officer of XYZ Corp. and tells you over dinner that the company's top-secret new high-tech mousetrap will make a shambles of the market. You rush out and buy the stock, which several weeks later soars on news of the new product. You sell at a big profit. What you have done is a crime.
2. It refers to buying and selling by a company's own officers and directors for their personal account. This type of trading must be disclosed to the SEC. Back to XYZ for an example: you read that the chairman, president and chief financial officer are all buying the stock heavily, so you buy some too. After all, they ought to know, right? Sure enough, a better mousetrap is announced, the stock soars, and you make a killing. Perfectly legal.