Put 2-3 pennies in a soda pop can, tape over the opening and rattle it when he begins any unacceptable behaviour. If it doesn't get his attention, thus stopping the action, try tossing it as his hind leg. It is light enough not to hurt and the object is to get their attention so that they stop what they are doing.I strongly recommend a book by a woman vet called "The Invisible Leash." That's where I learned of the penny in a can trick. It works, even with the cats!
The only sure fire way to keep him safe, though, is a lead or better fence.
Good luck,
kat