When you have a new puppy a good rule of thumb for housebreaking is the puppy can hold in his pee 1 hour per month old. For example, if your dog is 4 months old he can only hold it in for 4 hours. At nighttime puppies tend to hold their pee/poop longer because they are sleeping and there are no distractions.
Keep in mind that after the puppy drinks water he will probably have to go to the bathroom within 15 to 30 minutes.
The key to housebreaking is to supervise him during bathroom time while he is being walked outside on his leash.
If he is distracted and doesn’t go to the bathroom and you know that he has to go, you can put him in his crate or confine him (tie him down with a leash) in a place that if he messes on the floor it is easy to clean up. I would confine him in a place where he can be supervised so that if you catch him in the act, you can rush him outside to finish up.
As he gets older this schedule will change. Once the housebreaking is more consistent or when he no longer has accidents, you can cut down on the amount of bathroom walks.