2) Decide if you want to set up gates to keep him in the corner of one room or to obtain a portable indoor canine playpen. Both are good choices. Then, you'll want to leave the entrance to this open, so that he can investigate it at first...and then learn that its a good place to relax and play later on. You'll want to encourage him to use the area, so that he does not associate it with only being used when you leave.
3) Use a quality enzyme cleanser to thoroughly clean all spots that he has urinated on in the house. While dish soap or other cleanser may appear to work, they will not eliminate small trace odors of urine. Those lingering scents will be picked up by your Yorkie's nose
to signal that it's a bathroom area.
4) Within his new personal area, have lots of quality toys, blankets to cuddle, a quality canine bed, chews, Kongs filled with treats and water (best in a water dispenser).
These are made for dogs that simply cannot handle the empty feeling of isolation; it can help take some of that weight off of his shoulders. These types of toys are big enough for a Yorkie to snuggle with and the secret is a soothing, calming heartbeat that offers a dog the feeling of having company.
Place pee pads in one corner of this area, so that if he does need to pee (or pees due to nervousness) there is a 50/50 chance of it being done on the pads.
Keep his area set up at all times, not just when you are going out.
5) Every now and then, when you WILL be home, place him in his spot for anywhere from 10 to 20 minutes. Go about some tasks, allowing yourself to be in his line of sight. Do not respond to barking or calls for attention. This will teach him that being there does not necessarily mean that it will be for a long time nor does it necessarily mean you are leaving.
6) Do some 'practice runs' by having him home for only 30 to 40 minutes or at least 1/2 of the time you'll normally be done.
7) Do bring him out to pee about 20 minutes before leaving and then immediately place him in his area in a matter-of-fact way, closing the exit. This way, he will not learn that you leave the moment he's put inside with the entrance closed. This gives him time to focus on a new toy or notice a treat-filled toy without feeling nervous or antsy.
8) Unless you will be gone on a super sunny day and are sure you will return shortly, be sure to leave at least one light on.
9) Leave on a radio (pleasant talk show or easy listening music) or a television (pleasant 'old time' show such as The Danny Thomas Show).
10) When you arrive back home, do so in a low key way, not making a loud announcement. Peek into his area to see if he peed. If he did pee on the pads, that's great. If he missed and ended up peeing elsewhere, at least it was confined. Be sure to clean that area with the enzyme product we mentioned earlier.
The more you make his area enticing and the more you make short practice runs, the more your Yorkie will get accustomed to how things will be done now. Dogs are super adaptable and in time he will learn to calm down. With this new method, he at least will not be urinating all over the place.