Anakin Skywalker was initially set to make an appearance as a ghost in The Force Awakens, but he didn't make the final cut. Maybe it's because he looked so, so creepy.
Why the two-face treatment? According to artist Iain McCaig, it's because Anakin's got both good and evil natures inside him:
When you light a candle, you also cast a shadow. That inspired me to propose, for the first time, that Anakin’s ghost could come back … If we see Anakin Skywalker, because he does flow back and forth between Darth Vader and Anakin, let’s see him as a character with a dark and light side. The reason Luke is this whole new entity is because he was the first to acknowledge his own dark side — that it was not separate from him.
It's unclear what part of the film Anakin could have appeared in, but it's likely he'd either have appeared to Kylo Ren, or alongside other series veterans in Rey's Force vision.