There's been some really great, sound advice here.
Just wanted to add a couple of things. The praise and treats work really well in letting them know what you do want. But you can forget about the harsh tone of voice or any kind of correction to let them know they've made a mistake. It's hard for me not to let out a sigh when they make a mistake, but they know the difference between getting a treat for going in the right place and a sigh and a horrified expression on my face when they go on the carpet. That's correction enuf. One of the posters cautioned against being harsh and it's been my experience that you just teach them to hide when they go.
Since consistency and patience are the keys, I found that a collar with a bell on it helped me out a lot. You need to watch the puppy carefully and the bell can be just enuf extra information to give you an edge.
My dogs seem to be trained between 6-12 months in terms of knowing the command to go and knowing they're not supposed to go in the house, but it can take them up to 2 years to be consistent about letting me know when they have to go out. Up until that time, if I'm not watching or if they don't have access to a doggie door, I'm likely to miss their cue.
At this age if you can get him comfortable going outside; ie, not scared of noises or movements, etc, that's very good.
Good luck to us all!
CJ
PS My first Yorkie is 15-1/2 years old. I saw a chart recently that said 14 dog years = 100 human years. If that's true, that makes her about 115, I guess. She's been blind for about a year and has to sleep in a crate now, but she NEVER messes in there and barks repeatedly for me to come get her to go out to potty. I remember that I had to put her water dish outside to teach her to bark to open the door. Somehow that worked. God bless her. Makes these pups seem like such a royal pain in the butt