Training your dog to walk on a leash takes time. If possible, let your dog get used to the harness or collar and leash before taking him on a walk by letting him wear and  drag the leash around the house. This helps your dog get comfortable with what they are wearing before he has to listen to what you are saying outside. Start by walking your dog in as least distracting area as possible. A quiet cul-de-sac is better than a crowded park. Put several treats in your hand as you say “heel” and start walking. When your dog is next to you, sniffing your hand, praise him lavishly with “good heel” and occasionally give him a treat. If he pulls on the leash, stop moving, say “Nope” and stand there until he comes back to you. As soon as he does, calmly praise and move forward. Clearly release your dog with the word “play” before allowing him to sniff or potty.