I didn't let mine free range until they were 6 months old, will squat for me when I touch them. Otherwise, it could be a chasing game when they were younger and like to run away. When they were finally ready to be let out in our busy neighborhood, I let them out just 1/2 hr before dark to eat out of a treat jar. When I want them to go back into the run, I rattle the jar, throw a handful of treats into the run and close the door.
Once they were conditioned to follow the rattle sound of the treat jar and know to come running to me when they hear the sound, I let them out for a bit longer and farther, knowing that they will come back when called, or if I need them back quickly for whatever reason. Nowadays, they will roam around the yard and go back into the coop to roost in the evening by themselves without treats.
I still have to supervise a bit in case they wander off to the street, to the neighbors' yard or dig up the planters. Basically, by gently redirect their attention and directions. In our town, front and side yard fencing are not permitted, and the lot sizes are not that big, you can sight down everyone's front and back yards down the entire block, our chickens can easily wander off our property if they were not trained.