D.K.
Just ignore it the best you can. My daughter started this about at 5 and it drove me nuts, especially when her little brother took up the same habit. With her I refused to put nailpolish on her and that helped some, then I explained that her nails were going to have to be super short as germs and all sorts of stuff get under nails. Then I just ignored it. When she was close to me and did it I gently without saying a word removed her hand from her mouth. The more I ignored it the sooner it stopped though. I guarantee once he chews his nails down to the point of being painful, he will get the message. It took that happening a few times with my daughter.
It is a unconscious habit that will esculate if you point it out. Just be matter of fact, keep his nails trimmed so he has nothing to bite on either. If it is out of anxiety, try finding another way to get that out, talking, getting him involved with something with his hands like painting or drawing.