First of all you need to see if he switches leads on both hands or only one, this way you will see if he has a back problem and needs to see an osteopath or not.
If not, you need to keep your legs strong at their right place to make him understand he has to stay at this hand. If he changes anyway, make him stop, go back and then do it again. If it's a young horse, it is normal that he is not stable on his gait but you have to force him to respect what you want and what you ask him.
It will probably take time and repetition and for that, i wish ou good luck :)