Are you cleaning up accidents properly? You need to use a proper enzyme cleaner else they'll keep going back and doing it again.
Otherwise it just takes time and persistence. Some dogs take up to a year to be toilet trained properly, some get it within weeks. You need to go outside every time - we didn't bother with a lead for ours, just let him go off and sniff and do his thing. As soon as he did it, he got praised and a high-value treat (bits of sausage normally) and taken back inside.
Any time he went inside, he got picked up and placed outside, mid-wee if possible, then praised and treated when he finished the job outside. He was never told off or shouted at for going inside, the accident was just cleaned up as normal.
Another tip I learnt is never, ever let them out of your sight. If you have to leave the room, bring them with you, or crate them. Not only does this stop them getting into mischief but it means you can't miss them having an accident. So it's a bit like this:
7am: puppy is taken outside and pees/poos. Gets treated and praised.
7.30am: puppy wees inside and is spotted by owner. Gets told off.
9am: puppy pees inside but owner is in another room and doesn't notice. No consequences.
11am: Wee and poo outside. Again, praise and a treat.
This repeats all day. If you're not around to see them pee indoors, they won't learn not to do it. I would go back to basics. Take him out every 20-30 minutes, after all meals, after naps, after play sessions and training sessions. Praise and treat every single time he gets it right, ignore when he doesn't. If you can't watch him, he goes in the crate. Always.
Good luck!