An exercise I like to do are figure eights. Take half the ring on one lead, and go through the middle to switch your direction as well as your lead. During switching leads, you'll need to change your leg, apply pressure, and open the opposite rein so you can indicate the lead change. If your horse struggles with switching their lead, you could trot through the middle and switch the lead once you've reached the other side of the ring, and just build your horse up until the lead changes will be a simple task.
What I do with my horse that likes to run out to the rail when I do lead changes is I worked keeping him straight through the middle of the arena and then use my outside leg. It helps keep him balanced and stop him from running out. Also don't be afraid to use those half halts so your horse has to stay balanced and can't run from your leg.
For training the change set up poles on the diagonals and have them try to land the correct lead over them. For courses, leg yeild the horse into the change and then ask
After a fence get your lead change before you turn/reach the rail