you need to take him outside and watch him till he goes - If it has to be every few hours then that's what you'll need to do....and praise him every single time - throw a parade if you have to

but keep praising him. You can't expect a little puppy to automatically know where he's susposed to go
& you're right ...he's probably confused.....
Also - is he neutered ?? that may help with all the peeing in the house too. Some yorkies can take up to a year to train and some never actually are completely trained....I'm lucky - Chanel my oldest was a dream and trained completely in 2 weeks while Cheri still has accidents
Getting a puppy and giving it up because they aren't housetrained is very sad and this is one reason our shelters are full. I'd work with him every day if you can and you'll see progress. GOOD luck !