In both canon and Legends, Obi-Wan and Yoda can choose when to release their retention of consciousness after death. In both canonicities, though, why do they not stay around to help Luke rebuild the Jedi Order?
They are the last retainers of millennia of Jedi knowledge and wisdom that will be lost upon their departure - it will take decades or even centuries to recover them all from the archives at the Temple. Did they really think it wise to let a farm boy who barely qualifies as a Jedi Knight to play the role traditionally reserved for Jedi Masters without the slightest guidance?
Considering the ease of falling to the dark side without proper guidance and training, one would think that, if your goal is to prevent the triumph of the dark side, you would also aim to prevent its resurgence. Training Luke until he is ready to become a Jedi Master - and probably raising the first new generation to Knighthood - is probably the least Obi-Wan and Yoda can do to start the New Jedi Order off on a good footing.
So, why didn't they? I'm looking for both canon and Legends answers, as even though the story of Luke's founding of a New Jedi Order is different, the same question can be asked nonetheless since the rationale for why Obi-Wan and Yoda should have stayed is the same.