I have heard that if you crate train your puppy from the beginning that housebreaking goes easier. It worked for my Lab. Not so much for my Jack Russell.
I had to make the night time trips to the potty spot until my Jack Russell was about 4-5 months old. After that there were no accidents after she went to bed.
She still has accidents when she gets too excited over a visitor. I'm usually prepared for it and try to usher her outside so she can do it in the proper place.
Are male dogs more difficult to housebreak? My brother has a male Yorkie who still marks in the house. He's 1 1/2 years old. We have to really watch him when he comes over because he will do it multiple times. All the doors are closed when he arrives!