Similar to "stay" but different as its a boundary command.
Get a blanket, or a small platform 4'x6' works pretty well for training. Command place then walk around etc... and should he try to step off a no, aught, phuie, etc corrective word and correction (prong collar, scruff of neck, etc) to let them know its not okay to cross the boundary. Again, command place and let them stay there. 2-3 min the first few times, extending it to 5, 10, 15, and 30 within two weeks. Do it 2-3 times+ per day.
Essentially we have a carpeted area in the house surrounded by hardwood and he stays in place a lot. Great for when the doorbell rings, running out to grab laundry/restroom, or anything else wher eyou have to leave the room/sight of the pup.
Any boundary works, but to begin with an elevated platform is preferred and easily distinguishable to the dog. Then moving up to a blanket, carpet, grass, etc.
Unlike stay where they need to be stationary, etc. In place, they have free roam of the boundary to do what they wish, only can not penetrate the invisible boundary (floor to ceiling)
The other idea you could pursue is the invisible fence. Not a HUGE fan myself, as I believe that you can accomplish what you deisre with proper training.