I taught my dogs boundries with the front door, gate, curb, and the car. I would bring them to where ever I wanted to create a boundary, told them to stay and at first I'd just step in front if them then return and treat them. Then in a week I'd increase the distance and the duration if the stay. Pretty soon I was able to leave my gate and front door wide open walk out and across the street and my dogs wouldn't move until I returned. It's kinda like stay, but without saying it. They know they can not cross that invisible line without my ok first, it doesn't matter what is crossing I'm front either. The gate, door, and car were the most important boundaries I could teach them. This is how I taught my dogs some other people will have different techniques. I encourage you to find the technique that best fits you, your dogs and training style

good luck.