Hi A., here's a few ideas, but honestly, our son is 10 and we still have the problem occasionally! You are right to address it early because the longer they do it the more "natural" it seems and it's harder for them to quit.
One thing we tried was giving him a dollar worth of dimes in his pocket in the morning (we got idea from a Berenstain Bear book)....every time his hands were in his mouth, we took a dime away. Which meant every day he kept them OUT all day he got a dollar...but if they were IN he only got the dimes that were left (many times zero in the beginning). It really bums them out when they see those dimes keep disappearing back to Mommy when they are thinking of what they could buy. When he saves up enough you could let him pick out a small toy or if hes not getting many, maybe something small like a McDonalds cone?
I did buy and use "THUM"...it's intended for nail biting but works because fingers taste bad. It does work! You might have to ask the pharmacist for it if they keep behind the counter or have him help you find it. It is a very tiny bottle so it's hard to find on your own.
Another thing that sounds kind of gross....we told him (for instance) that if he put his hand on a doorknob he was touching everyone who had touched that doorknob....all the little boys who used the bathroom and didn't wash their hands...he was touching their pee (or worse!) and then putting their pee in his mouth...we were very specific and mentioned all the things, like if they had sneezed into their hand and touched the knob, he was putting their snot in his mouth...how gross is that? That worked for a while.
We also talked about the germs and how when he gets sick he misses fun things he wants to do. And this was kind of mean, but when he would have them in mouth and I'd be nagging "get your hands out of your mouth" for days on end, and then he'd end up sick....then I would say, "Oh, you're sick, that's a bummer because we were going to (fill in the blank w/ something he wanted...go skating, mini golf, bowling, a movie, etc.) and now we can't go because you're sick." I know it sounds cruel but desperate times, desperate measures!
We've also done loss of privledges...for instance, he loves to play PS2 so now if hands are in the mouth, no PS2 for a day....if he's already played his hour that day it means he can't play the next day. Lots of times this works (but not always!) For you maybe it could be no Batman show (or Spiderman, or whoever he's into) because thats a big kids show and big kids don't put hands in their mouth...we used that line when he was about 6.
As you can see, we have tried many different things over the years...it might take a few approaches to see what will work for your son. We tried to be consistent but what would happen is that something would work and it would seem like we were over it...then he would get stressed or upset and we'd notice one day he has them in, and before we know it we're back to trying to figure out which method to use again! I think some kids are more "oral" than others (ours is one of them!) and just want something in their mouth. I hope one of these ideas helps you! Good luck!!! J.