He knows boundaries in the house and when around on walks, but we never did it for the garden in the backyard.
At first, I didn't worry about it. He's usually interested in sniffing the grass or listening to what's going on all around. Sometimes, he sniffs the wind or such. However, today, he relieved himself in the garden! Fortunately, it was on top of some weeds and not on any vegetables or herbs.
Another thing is that there's tomatoes growing, and I don't want him to lick or take a curiosity-bite of a tomato leaf, which could hurt him and make him sick - not to mention the chance that he could break some stems and vines, which would hurt the garden.
As such, today, we worked on boundary training with the garden. Just like with the other scenarios, there's (typically) a clear division between the garden and the rest of the yard (motivation to keep that grass trimmed I guess!!), and I can use it to help him explain the differences between the yard area and garden patches.
To do this, I turned to shaping again, and caught him doing the right thing first, staying away from the would-be boundary. As long as he stayed behind "the line" then he would get rewarded. He also pawed it, which was rewarded and then I held out for him lying down. Once he did that, he got rewarded heavily and he kept offering it like he does when we review this in the kitchen.
The familiar nature of the task helped him, and he quickly took to it. It's a matter of practicing more so he can continue to learn where the off-limits areas are.
In addition, I wanted to teach him the paths he can walk on, so he can learn how to get around the backyard. It was a mix of the boundary training (if he went across the boundary, he got redirected), and mixed in some recall so he could get used to coming around the paths even while excited. To increase the challenge, I put central garden area between us, so he can't take a straight route, but had to use the paths to get around the garden.
We will have to keep practicing, but he did quite well for the first day of being exposed to the "new rules".