When David told Joab to count the men of Israel, he did not tell him to count the men who were less then 20 years old, because Yahweh had promised many years previously that there would be as many people in Israel as there are stars in the sky.