Obedience is obeying God's Word, legalism is obeying man's rules that are not in God's Word. Its pretty simple, but because so many churches make rules that are not specifically mandated but seem moral, people become confused about what are God's commandments and principles and which are mans. I never obey man's rules if they don't make sense to me. I obey God, sadly there are those who misuse the scripture to justify their man made rules and then intimidate others into obeying them.
1 Peter 5:2-4 "…2 Be shepherds of God’s flock that is among you, watching over them not out of compulsion, but because it is God’s will; not out of greed, but out of eagerness; 3 not lording it over those entrusted to you, but being examples to the flock. 4 And when the Chief Shepherd appears, you will receive the crown of glory that will never fade away."