No matter what age your dog is, it's important to use a crate or kennel when housetraining, and also to keep them on a strict feeding and potty schedule. Dogs naturally keep their "den" clean, so by restricting their movement with a crate or kennel, you are encouraging this natural behavior.
Keep to this strict crating protocol for at least six months. Once going to the bathroom outdoors becomes a habit, your dog should start asking to go out. Test them by gating them in a room with solid floors like tile, so if they do have an accident it will be easy to clean up. If they aren't yet reliable, go back to using the crate.
Never reprimand your dog when they have an accident. Positive punishment does not work for this type of behavior modification, and will likely make the situation worse. Likewise, I would not encourage giving treats when they go to the bathroom outdoors. The process is a natural one and shouldn't be entangled with too much praise or treats.
Questions? Contact me: firstname.lastname@example.org