He should be put on antiparastic medications to combat this issue. He might not be eating right I guess as he has been having such issues on a frequent basis. So pay more attention on his food habits. And also washing his hands with a good soap each time after defecation. Also the dirt under the nail should also be cleared as it can carry the worms.