I found this to be a helpful article on legalism,
No one leading God’s people wants to be accused of “legalism.” But what is it and what does it mean? I found the article that follows by Tony Reinke helpful in better understanding just what legalism is.
Rules and Scripture
Almost 900 passages in the Bible contain the phrase “do not” … There are a lot of rules in the Bible… If you apply the entire Bible to the Christian life, you can end up with a long list of helpful rules and reminders (i.e. the “one anothers”)… The fundamental danger of legalism is not living or not living by rules… Legalism points to a much deeper heart issue.
A false gospel
At its most dangerous level, legalism is a soteriological problem. That is, legalism is a false gospel and a false hope. Legalism is the lie that says God’s pleasure and joy in me is dependent upon my performance rather than the finished work of Christ.
It is legalism that causes the Pharisee to look proudly into the sky in the presence of a tax collector. It is legalism that causes a poor missionary in Africa to think God is more pleased with him than an American Christian businessman driving a Mercedes. It is legalism that causes the preacher behind the pulpit to think God is more pleased with him than the tatooed Christian teenager sitting in the back row.
Legalism causes the heart to forget that God sings over us because of the work He has done, not because of what we have done (Zeph. 3:15-17). Believers equally bring pleasure to God because the pleasure He receives in us is the purchased pleasure of the substitution of Jesus Christ. Any imagined superiority to other Christians (not rules or a lack of rules) is the sure sign of the legalist.
Rules are not the problem
And whether our convictions are biblical or unbiblical is another issue altogether. Legalism is not so much objective (are my convictions biblical or not?) but subjective (what do my convictions get me?). And this is what makes legalism dangerous whether your convictions are biblically accurate or not. From what I hear, often what is labeled as legalistic too often focuses primarily upon rules or a lack thereof rather than the gospel.
As I’ve seen in my own heart, what sustains self-righteous legalism is a failure to boast only in the righteousness of the Cross of Christ. Once I take my eyes off the Cross I begin boasting in my list of rules or boasting in my lack of rules. Either way, I know I have fallen into legalism.