I've read your post and try to give you some thoughts to try to help your dog from the information you have provided for you to consider or disregard, as I will try to honestly access what it sounds to me that the problems are. Thanks to that trainer and some poor advice and perhaps a lack of dog-handling skills, you little hyper-excitable, high-energy, intelligent baby sounds more like a POW at times than a pet! The problem is likely not with him but with an inconsistent training/handling program of confusion and lifestyle he cannot understand or accept. He sounds thoroughly confused as to what is expected of him.
I'd first get him thoroughly examined by a vet from teeth to tail with blood tests, urine/fecal tests and get a clean bill of health as he could be ill or have an occult injury or something causing him physical problems.
Yorkshire Terriers are intensely personal dogs and yours wants you to show him lots of love, cuddles, to be with you every moment and lots of attention and love - that's what you got him for. He wants lots of positive reinforcement for everything he does right. It just makes them shine to know they have pleased you. Dogs are pack animals and not human sentries and need to be treated as members of our family for the most part, remembering their canine instincts kick in and we can harness those instincts with re-training in order to live successfully and happily with us.
Most Yorkies want to sleep touching or near their other pack members at night and to spend the day with them in life-enriching, fun, mentally-stimulating activities or resting on our bodies or very near us when we aren't up and about. We are to show firm, gentle leadership, show them their boundaries and reinforce those to the uttermost when they exhibit behavior we disagree with and stand them down until they desist and turn away or relax or give up, not in a fearful way that scares them but as a mother dog would her pup. I'll tell you how to do that later if you'd like.
I got my dog Tibbe when he was 9 mos. old, kennel-crazy from spending his 1st 9 mos. of life alone in a cage outside under a shed so he was wild, almost feral and totally fearful of humans, sounds, things and life in general. He screamed at the top of his lungs when I crated him but I taught him his crate was a friendly, warm, quiet, wonderful place and in time, he loved going in it. I never used it for punishment or "time out" as it was to be his refuge during the times I couldn't be with him until he was housebroken or when he had to spend time at the vet or in it during some type of emergency situation.
I spent the first 18 months I had my dog housebreaking him by confining him only when I left the home or left the room to work at something and couldn't be watching him for evidence he was about to pee or poo. Otherwise, he was out and about and almost always literally on or near me, getting loads of praise for every good thing he did. At the end of his 18 months, he was totally clean in the house - unless he's ill & cannot help having diarrhea - but otherwise, he'll hold himself all day if I'm away a long time and won't even use the pee pads I put down. When it's storming and pouring rain and he doesn't want to go outside, he won't even use the front or back porch he's so firmly housebroken to go only on the grass or dirt!
When he was out and about, I kept him within eyesight of me so that when he was running about in the room(I kept him confined to whatever room I was in by not allowing him to leave the room for that 18 months by saying "uh oh" if he neared the door and getting up and herding him back inside the room over and over until he got the message he must stay in whatever room I was in), I could watch him and look for evidence of his staring at me, staring at the door to outside, going around urgently in fast circles, sniffing the ground like a madman and with great urgency or right after meals, grooming sessions, heightened excitement of any kind such as visitors coming/going, etc. He's had total free-run of the house since that 18 mos. period was over!
All of these things usually precede a dog needing to go potty. That's when I'd say "Wait! Let's go potty outside" and rush to him, scoop him up the first few weeks and later get him to rapidly follow me outside. Then, a big praise when he did actually "go" and a nice treat which I always keep in my pocket. I treated my dog for almost everything he did right for his first 5 years with me and he comes running anytime I say "Tibbe, come!" or any other command as his treat/praise training made him happy to always obey. (Even now, he knows praise and a treat are possibly forthcoming but always praise. He's always praised and he just feeds off it. He'll do anything now to get my pleasure in him.)
Plus, to start him off right and imprint his brain that pottying was to be done only outside, the first 3 weeks or so after I brought him home, I just routinely took him out to potty every 30 minutes from morning until bedtime!!! It nearly killed me but he got it! He got the message quickly that no matter what, he'd be taken outside with great regularity and that outside was the natural place to go and leave his scent and markings for all the world to enjoy.
In time, he learned to hold himself for the next 30 minute window and the chance to go potty and mark all over the outside back yard and in time, he could hold himself up to an hour and then two and finally, 4 hours. He now usually needs to go pee about every 4 hours - longer if it's raining or I'm not home - and he always goes Potty #2 in the mornings after breakfast and at night just before 10:00 p.m. But should I be away from the house over 4 hours, he will hold it as he's learned that outside is the right place to go and he just refuses to go anywhere else. Once a Yorkie learns a way of doing something, he'll always want to do that thing that way forever as he's got a sense of what is expected of him. Yorkies love to do what they know is right.
I can give you some pointers and specific training tips and ideas I used in rehabilitating my dog from a wild thing to a well-behaved, happy, feisty little companion who is a total joy to have around, if you'd like.
If you want to use some of my ideas for your dog, for starters, could you describe his day - what his activities are and how much time he's confined, etc. from morning to the last thing at night? Then I could give you some starting training tips to get you all out of the bad place you seem to be and go from there. You can totally reform this dog if you bring him along slowly and show your love always, train him using only positive reinforcement, keep his training always fun and upbeat and give him fair but firm boundaries of behavior that he cannot cross without you stepping in to stop him without any fear or harsh, scary techniques. Hugs to you for reaching out for help for your sweet baby.