Here is what we did:
1) Crate training. No less than 1 hour in it at first. Everytime the dog goes in for any reason, it sits there for an hour, even if its barking/crying. It will do it alot but they will get the hang of it in a few days. Don't let it bother you. It builds up their bladder control. Dogs don't pee in confined spaces they are in unless they have no choice.
2) Train the dog to verbalize or to get your attention when it needs to go outside. Alot of dogs will go to the door (out of habit) but they dont send you any messages. Then pee in the house because you ignored it sitting by the door (because you didn't notice it). Do not train it to jump at the door, as it will scratch doors and if you visit friends/family, its a bad habit. Teach the dog to "speak." (This is pretty easy if you do do it yourself, train it with treats and the sit command so it knows its training time, then say speak and howl at the mooon until it mimics you, then give it a treat, or bark if you prefer that method.) Then you can train it to "speak" at the door when it has to go potty. One of my dogs actually comes over to where I am and rest their head on my knee with puppy dog eyes "will you please let me out?" and their tail wagging (they came up with this technique on their own, I did not train them to do it)
3) When you bring the dog outside, teach it to "go potty". Just keep saying "Go potty" every 5-15-30 seconds until it does. Then praise it when it does, do not let it in or off on it's own until it goes potty (call it back if it tries to wander off.) My dogs when they go outside, if I say "go potty" they will go squat/pee instantly even if nothing comes out but they go through the act of trying. This is handy at night or when you know you won't be home for awhile. It's nice to know they emptied their bladder completely.
4) One thing I noticed with my female dogs is that if they have to go potty at night, and they are in my room on the floor next to my bed, they have a tendency to start licking themselves alot in that area rather than going to the door and/or whining. Maybe they are too tired to get up, not sure. This is a good sign they probably have to go pee. Try to notice it and let them out if its waking you up or happening constantly. If you have a puppy you will want to put them in a box otherwise they won't stay in the area. They probably do this even during the day so if you start noticing it lick itself down there alot, it's probably time to go out in general.
5) With a puppy I always make it go ut every hour at first (and see the go potty point above) so they get used to the routine. I don't wait for them to tell me, I make them go.
I've only had my dogs pee in my house maybe 3-5 times total (between the two of them) just doing the above.