Get some training pads. When he has an accident, touch the pad in it and set it out for him to find. After awhile, move the pad to the door, then eventually outside. Then just start putting him outside. Crate training works well for older pups because they won't 'go' where they sleep.
Well we spanked my dog and he learned pretty quickly but I don't think thats the nicest way to potty train him. So when you see him/her doing it make a lot of noise and they will jump up and stop then just take them outside to finish
Accidents happen,be patient.Potty training can be easy if you stay on routine,depending on age of dog try to let the dog out every 2 hours at first.On dogs that are few months old,they tipically need to go more often . Once you get to know the dog , in most cases you'll see and hear signs that will hint you to take him out.as dogs get older they will hold it for a longer period of time, avoid food and water after 6:30 so that will prevent getting out at night.