Dogs may run away for a number of reasons. If you have an intact (not neutered) male dog he may run away to mate with a female that is in season and nearby.
A happy Spaniel full of energy on a long walk
Some dogs run away because they are bored or lonely. Your dog may be running away because it has too much energy. If you aren’t exercising your dog enough he may feel the need to exercise himself.