I'm looking after my friend's dog for the summer and he's staying at my house. The kitchen is entered from the living room, and does not have a door that I can close. Whenever I'm in the kitchen to cook, he doesn't dare enter the kitchen because I told him not to a couple of times. However, even if I go to the office for an hour or two, I come home to realize he has been in the kitchen. Once or twice I had forgotten to take the trash out in the morning, and came home to realize that he destroyed the trash into tiny pieces, presumably eating what he could find. Is there any way that I can train him so that he never enters the kitchen?
I am sorry, but there is no easy possibility to train the dog not to enter the kitchen when you are not at home and there is no training which will work at 100 %. You already trained the dog not to enter when you are around, the dog respects you, but you have no possibility to control his movements when you are not there. A dog does not understand if you punish him when you come home and find out that he was in the kitchen. You can't explain it.
Training problems - an example
You could try to "catch" the dog. Leave the dog alone, and wait in front of the door. Use a camera to watch if the dog enters the kitchen. If he does, immediately go inside and rant. But there are three problems with this kind of training:
The timing. Likely you are not able to open the door fast enough before the dog recognizes you and leaves the kitchen to welcome you. If you then shout to the dog, he won't associate your behaviour with him being in the kitchen, but with welcoming you.
Wrong association. Even if you are fast enough, the dog may learn something wrong. He may associate: "If I go into the kitchen when 'my master' is not at home, he/she will come back immediately." You don't want this, because then the dog may entering the kitchen more often and may get frustrated, if you are not coming immediately and may destroy something, because of frustration (depending on the character of the dog).
Dogs are not stupid. Even if you have the perfect timing and the dog does not associate unwanted things, he will learn fast enough, that you won't catch him all the time. Dogs are masters in having a feeling of the time when owners leave or coming back regularly, in interpretation of mood and situation. He will learn if you are leaving for work or for training very soon. It is highly possible that after a while you think that he won't enter the kitchen anymore, because of your training, but he still enters the kitchen when you are away for a longer time.
Another possible solution
There are some other possibilities, like invisible fences. The dog gets an electroshock if he enters the kitchen. The advantage is, that the dog is training himself even if you are not at home. But this kind of "training" has some disadvantages, too.
Costs. This solution is not the cheapest one and needs some effort to install the cable.
Unwanted caging. The dog may enter the kitchen and gets a shock. He is scared and jumps. But not back, but into the kitchen. Then he wants to leave the kitchen. He is more cautious, gets a shock and jumps back. The dog does not dare to leave the kitchen anymore. Not exactly the result you wanted to have.
But if you try it more often, the dog may learn not to enter the kitchen. You could give it a try.
My personally preferred possibilities are to have a physical barrier like a fence or to make the kitchen boring for the dog. Don't leave unwashed dishes or food lying about and always clean the kitchen, so that the dog has nothing to feed and lick.