It's something that boys do as they get older, it may seem inappropriate for us as adults, but to them, they are just curious about this extra thing sticking out of their body and what it does.
Sometimes, trying to shame them or force them to stop do more harm than good - like what other mummies have shared, just educate him right that it is for him to pee with, and sometimes he might feel weird with it - but it's okay. It's also a good time to teach him about safe/unsafe touches and what to do if someone tries to touch him in those areas!
Other than that, just ignore it and they will stop doing it after some time :)
Read more