Male dogs often have a yellowish greenish discharge from their sheath. I have had a male dog who did not have this and one that does. It is usually normal. If it is new and something you are just noticing now -it is good to call vet to make sure.
Unless he is licking a lot or it seems excessive it is normal. Our 6 month male has the same thing and I worried as well-
Here is some helpful info: All male dogs have a yellow-green discharge. It’s actually coming from the sheath, not the penis. The material, which looks much like pus to the naked eye, is actually made of cells and lubricant fluid in the prepuce that surrounds the penis inside its protective sheath. https://www.mypetsdoctor.com/male-dog-penis-and-sheath-discharge