Mine get fed at roughly 8am and 8pm, a mix of wet and dry.
This is not a criticism, and probably not relevant, I’m just kind of thinking at you 😂 but…why does he need lunch, but then is going 14 hrs between dinner and breakfast? Why 4pm? It seems awfy early. Unless you’re going to bed at like 7, I’d definitely space his food out more, but it may or may not make a difference.
But your most likely issues are going to be one of…
he’s not fully housetrained - was he housetrained when you got him? What’s he like through the day? Are you cleaning it with something that’ll remove the scent properly? (Not for you, for him)
His overnight is too long for him - what time is his last walk and last chance to go to the toilet? Does he maybe need an evening stroll? (Some dogs do) is there a particular time he’s going through the night?
Stress - is he ok by himself through the day? It’s real common for rehomed dogs to get a bit of separation anxiety for a while.
Something is waking him up and then he needs the toilet - which is where the feeding timing might come in, he could be waking up hungry, or there’s a noise from outside or he’s cold… something like that.
Type of food/ medical issue - is it normal amounts/ consistency? Or loose? (Though stress can also cause loose stools)
Sorry, that’s just a load of questions mostly 🤣 but it’s just that why he’s doing it is going to be how you know what ti do about it.