They end eventually. Generally accidents are human error not puppy error though. At any age. I am nto saying it's easy, I had a rough go with my adopted dog even though I had gone thru the whole thing over and over again with all fosters. It took me longer to "get with it" and synch with her potty shedule.
When he just comes it, has he had a full pee outside recently? Or did he do a short pee then come in? Did he do a long pee when he first went out but spent 20 minutes playing and is not just coming back in?
Until they are much older keeping accidents at bay are about setting them up for success. Learning their shedule. learning their habits and predicting things so you can be a step ahead. Limiting access to areas in the house, etc.