User blog comment:KaharZamet/Star Wars Movies: Alternate Endings/@comment-5651931-20140621201601/@comment-4935956-20140622011110

Obi-Wan, Qui-Gon, and Yoda were force ghosts because they were always light-sided. Anakin, however, was able to redeem himself back from the dark side so he got to be a force ghost too. Luke died as a dark sider though so he's not a force ghost - though his spirit may still appear to Sith.