People think that older dogs will be house-trained but this isn't always the case, especially if they've spent time in kennels; it's best to start from scratch.
House-training is about the owner setting the dog up to be successful, in the right place at the right time, until eventually the dog will associate that location with going to the toilet.
To start with, take your dog out first thing in the morning and then every couple of hours including after meals, naps, or play. Keep a note of when he goes to the toilet as this will help you to know when to ensure that he's out.
Go out with him so that you can calmly reward him once he's toileted. Some dogs may be worried about toileting in front of people, so if your dog seems concerned or is hiding, try not to pay too much attention to him and this will help build up his confidence.
Telling a dog off for toileting isn't worth it. If you punish him afterwards he won't associate the punishment with his behaviour, and it's unlikely to change in the future.
If you tell him off while he's toileting he may become worried about going to the toilet when you're around. If there is an accident, calmly pop your dog outside or in another room while you clean it up.