I trained my dog to run with the bike using three commands, heel (on my left, shoulder level with BB), back (about 6ft behind rear wheel), and go (run ahead) he liked to go about 20-30 ft, I guess at that distance he could still hear the bike behind him. I was working on LEFT and RIGHT too.
Patience, practice and loads of praise were the key to training him. Plus start young.
On bit of advice, when getting them to run behind, don’t let them run too close ie. Emergency stops, plus you’ll end up covering them with crud off the rear wheel!
I used a bar end mirror to keep my eye on him when training the behind command. Saves riding into a tree while trying to look over your shoulder.
Some of my favorite rides were with ‘Mr Fred’ the Staffie/German Shepherd cross.