New pets are suppose to taken to a vet within 48 hours of acquire them. Take it to a vet to rule out any possible medical issues first, bring a fresh (less than two hours old) urine/fecal specimen as well, once medically cleared,then train/correct him.
You've hardly provided enough time for him to adjust to his new surroundings, that alone may take a month or more, training won't happen in a matter of weeks, depending on the individual dog, and if you're patient, consistent, diligent, willing to put in the time/effort, and do it properly, it may happen in 6-18 weeks or could take as long as 6-18 months.
Nor does it end there, any training must be enforced as needed, for the remainder of the dogs life, 12-17 years. Dogs do better if on a set schedule, including walk/elimination times and feeding times, water should be available 24/7, free choice.
Provide sufficient daily walk/elimination times outside, every 1-2 hours and once in the middle of the night, staying outside, until he eliminates, praise profusely once he has before coming indoors, supervise constantly while indoors, correct immediately when caught in the act, securely contain in an already dog proofed area, everything put away so he can't access anything, as well as an area that is easily cleanable. and you clean thoroughly, using an enzyme product specifically made for that purpose, ONLY when you can't supervise, such as the 3-4 hours in the middle of the night while you're sleeping.