All the other advice is good advice. Dogs get terribly jealous and mopey, a lot like kids.
Do you have a large crate? I know that punishment with scolding tones and then being left in the crate for a while works (at least on the smaller dogs). They get that its bad and think twice about the next time.
You can walk them around the yard and while they are in the bounds you praise them. On a leash at first just all around the boundries you want them to be. Then you try dropping the leash so they think that you are still holding them and praise them while they are in the area you want them to be. Saying NO or STAY if they try and go beyond that and if they insist "BAD dog" then the final step is you walking with them no leash. This may take some time and patience but old dogs can learn new tricks. This one worked on our schkipperkee named Phoebe.
How open is your yard. When letting the other one in and out maybe the other should be tied with just enough rope to not go out the gate but have free run of the yard. There are these pully systems now (look like a clothes line) so that they can run free in their yard but not past.