My dog Sheeba didn't "get" house training until almost 7 months old. There were spurts where she did understand but still had a few accidents. Sandy came to us as an adult but was an outdoor dog at her old home. But house training her was a total breeze compared to a puppy.
I thought I would go crazy with all-hours potty times going outside. Sheeba would ask to go, but then just play and not potty. Other times she would go out and pee but then come back in the house and pee again, or an hour later poop on the floor. It did get slightly worse when I got her spayed but then everything got better.
Then one day there were no more accidents. The change was sudden. And it was glorious!
No more stepping into puddles when half awake. lol
Feed regular meals at specific times. Then time how long it takes your dog to digest and eliminate.
The way I checked this was to occasionally feed raw egg and shell. When I saw confetti poop, then it was easy to figure out the timing.
One last thing, find out what signals your dog gives and encourage the signaling. Sheeba tells me when she needs to potty by first leaning her chin on my leg and then when I ask her what she wants, she sits pretty on her own without me asking (she sits pretty for lots of stuff though) and then I say "show me what you want" and she then runs to the door, sits and waits. Sandy gives me a nose poke and then dances around.
Hang in there, it gets easier.