According to dictionary.com -
a. the doctrine that salvation is gained through good works.
b. the judging of conduct in terms of adherence to precise laws.
During the time of my life when I was caught up in the doctrine of legalism, I was more involved in "b" than "a'. I had a set of strict guidelines - some Biblical, some self-imposed - and if others didn't follow those same guidelines, I assumed they were not a Christian or at least not as good of a Christian as me. It certainly made me feel good about myself (how pathetic, huh?) - a false sense of holiness.
In my personal experience, legalism leads to feeling better about oneself because of living by a set of laws or rules and being better than others instead of comparing ourselves to Christ, knowing we can never measure up to that standard, and understanding His grace.:godisgood: