We've all heard the analogy where a person draws a circle and then places a dot in the center. The greatest obedience to Christ is in the center. What is technically acceptable to God is still within the circle, even though it may not be the most desired by God. The question is then asked, "Are you trying to get as close as you can to stay within the circle, or are you trying to just stay on the outer rim of the circle?" The analogy is helpful in attempting to show someone that they may be living out a legalistic view of God, where they just want to be acceptable by God so they don't have to go to hell, but they don't really love Him or they would be moving as close as they can to the center.
Many people define legalism as holding one accountable for what is not explicitly stated in Scripture as a sin.
This, of course, is an absurd definition, one which even condemns Christ as a legalist.
For instance, in His condemnation of the Pharisees for their not having honored their parents with their money, the Pharisees could have simply said that He was adding that to the Word of God. Certainly, there is a command to honor one's parents, but there is no command that finds that one must express the command in terms of giving money to them. That is simply an extrapolation from the command, but not in the command itself.
Now, one can argue that Jesus can add whatever He wants to the law, but is it fair for Him to condemn them and act like they should have been obeying the law in a way that was never commanded explicitly in the text?
In fact, Jesus seems to say that the spirit of the law is found in the principles they express, not in the explicit rules themselves. This seems to be very much the point of the Sermon on the Mount, where the law against murder expresses a principle to value the life of one's fellow believer, the law of adultery expresses a principle to keep one's desires toward one's spouse. But these are not explicitly stated.
There is no command in Scripture that condemns pornography, pedophilia, beating one's kids, police brutality, racism, etc. But there are plenty of commands that reflect deeper principles that would condemn all of these things.
This idea of legalism also reflects how one views Scripture as a whole. If Scripture is some rule book, where I only have to do what it commands explicitly, and am free to ignore the principles, then actually I now am arguing for the type of antinomianism for which the Pharisees were condemned by Christ. Their form of legalism existed as their own cultural rabbinic ideas of what made a person a good upstanding citizen in God's kingdom, all the while ignoring the principles of Scripture because they "technically" obeyed the explicit laws they were given. Christ's point is that their law was loveless, and because it was loveless, it sought to only obey what it thought it had to obey, and did not actually seek the fullness of God's kingdom principles to reign over their relationships with one another. Christ concludes that a loveless law, ironically, is a lawless law that does not care what God actually meant to convey in His law.
Christ's teaching comes, not to nullify the law, but to restore its purpose as that which directs His people in its principles to love God and love thy fellow covenant member, who represents God, as one loves himself. And there is far more to loving God and neighbor than obeying a few explicit rules that do not cover the larger domain of life and godliness.
In short, legalism is really found at the outer rim, where one only desires to be "good enough" to be saved from hell, but has no desire to conform all of life and practice to God's principles. The irony, therefore, of course, is that those who call others legalists for not having explicit commands as their prooftexts, is itself a legalistic claim. What one needs to show is that the principle is not scriptural, and this takes a lot more Bible knowledge and exegesis than the average person is capable of producing. It's much easier to throw around ad hominems like "legalist" than to do the hard work of casting off our satanic traditions and practices that may not be explicitly condemned in the Bible, but are in fact condemned in the principles implicitly expressed by what is explicitly said.