Does Anakin Skywalker turns into a bad guy and then turns to a good guy or he is just a bad guy?

Anakin Skywalker is good in the first two movies Episodes I and II but becomes evil in Episode III: Revenge of the Sith and becomes the "bad guy" (or evil) Darth Vader at the end of the movie. This is because his body is nearly destroyed in lava forcing him to create a robot like body for himself because he will die if h doesn't have it.

In the original trilogy Anakin is still Darth Vader, who is a apprentice to the Sith lord. In the last installment of the original triolgy Episode VI: Return of the Jedi, again in the end of the movie Darth Vader/Anakin kills his master the Sith lord while protecting his "good" son Luke Skywalker, thus making him a "good guy" at the end of the whole six movies.