With my puppies I separated heeling training from loose leash training. The more I think about it, the more I think these are really separate concepts. I agree with others that 4 months is really young. He's got a lot going on in his brain, and at this point he's not going to be all that clear on the concept of either walking at heel or walking on a loose leash.
I did their initial heeling training off leash. The idea here was to make heeling a fun and rewarding game, not something enforced with the leash. I started by introducing the puppy to clicker training. Kikopup has a good video on
how to start clicker training.
Once the puppy understood what the clicker meant, I just walked around my yard. I didn't call him. I didn't penalize him for paying attention to puppy interests. I let him decide of his own accord what he wanted to do. The puppy wanted to play, and I was moving, so pretty soon he started following me. By chance he wandered into correct heel position. At that point I clicked and handed him a treat. Then I started walking again. Same as before, he bumbled around after me and eventually wandered into heel position. Again, I clicked and gave him a treat. After a few more times he realized that he got treats for staying by my left side. He then glued himself into position. At that point I made the game harder for him. I walked close to lawn furniture, so he had to adjust his position. I made sudden turns. I changed my speed. Every time he found his way back to proper heel position I clicked and gave him a treat. He thought this was a fantastic game: chasing me while getting fed treats.
A second game that I played was hand luring. Again, Kikopup has a good video on
teaching hand luring. I taught it a different way, by folding a treat against my palm and clicking for a nose boop. However you choose to teach it, the important thing is to get the puppy following your hand. In my opinion hand luring is one of the most important skills you can teach a puppy; it's foundational for a lot of other work.
Once my pup was good with hand luring I used the hand lure to teach the commands Front and Close In. Front means to come straight up in front of me, nose pointed at my knees. Close in means to come to my side in heel position. (I'm standing still, which is why I use another command than Heel.) Once he understood these commands, we played hand luring games. I would move my hand down to the floor, up onto a chair, Front, Close In, etc. His job was to move himself to where he could Touch my hand.
So, once you have these off leash heeling and hand luring games established, you have something you can do on walks to get your pup into heel position (or anything else.) However, no young dog wants to walk at heel more than a few dozen feet or more than half a minute. Keep things fun and don't push him past his attention span. Play a heeling or hand target game, then let him go back to sniffing. Half a block later play another hand target game. Mix it up.
Now, finally, we are at loose leash walking. Like you, I taught it using the stand like a tree method. However, I did not use treats to lure the dog back to my side. I think it's possible to set up a cycle of hitting the end of the leash, returning for a treat, hitting the end of the leash again, returning for another treat, and so on. That's not what you want. When a puppy is pulling, it's usually because he wants to go check something out. Therefore, you can use access to the interesting thing as the reward instead of a treat.
When the puppy starts pulling, stop dead as you have been doing. Note where his head is pointing. Then just stand there until the pup looks back at you, "Hey human, why aren't we walking." Usually the puppy gives you just a little bit of slack when they look back over their shoulder at you. As soon as you feel this change in leash tension reward the puppy by taking a step towards whatever he was looking at. The puppy will probably start pulling again. That's normal and expected. Stop dead and wait for him to give you a bit of slack. Again, take a step towards whatever he was looking at when you feel the leash tension change. In this slow and interrupted way you will eventually reach the pee tree or whatever he was leading you towards. Let him sniff to his heart's content.
After a few of these stop-start-stop-start situations the puppy will realize that you stop after taking a single step. Instead of rushing off he will move hesitantly, because he expects you to stop immediately. The leash will remain slack because he's moving slowly. Now you can reward him by continuing to walk forward. He won't initially understand why sometimes you stop and sometimes you keep walking. Eventually though, as long as you are consistent, he will realize that you will keep walking as long as he isn't pulling. He will walk at your pace, with the occasional glance to check on your progress. Make sure to reward him by following him to whatever he wants to sniff and waiting until he is done with his investigation. It takes a lot of practice and consistency before a puppy concedes that pulling really isn't a successful way to get what he wants. Some distractions, like a smelly fire hydrant, are relatively easily mastered. Others, like squirrels and rabbits, are much more tempting. It could be a year or more before he develops the impulse control to resist them.
My senior dog has learned two different ways to ask me to change direction. Sometimes he gives a single sharp tap on the end of the leash and then glances over at me. (Yes, my dog leash pops me.) Once he is assured of my attention he looks where he wants to go, glances back to make sure I'm following, and sets off in the new direction. The other way (when I'm being a good human that doesn't need a leash pop) is that he will slow down and start walking parallel to me but not in heel position. He stares at me until he is sure he has my attention and walks slower and slower. I then ask him, "Do you want to go this way?" and make a 90 degree turn. If I have guessed correctly he sets off again at a normal speed. Otherwise I need to try a different direction. Sometimes we turn around completely and backtrack, so he can sniff something he missed when we passed it the first time. Again, these opportunities to sniff are his reward for asking politely instead of just dragging me to what he wants to investigate. I always want him to feel that not pulling gets him to where he wants to go.