M.M.
This is exactly the age when curiosity about the human body kicks in. Perfectly normal. In another year he'll understand private parts more,
Don't make him feel terrible about this, and try to keep the conversation more neutral. Just tell him that it's perfectly natural to be curious, and if he wants to know what the human body looks like you'll show him a book (there are age appropriate books for kids that give the basics without being too graphic.).
But that the parts of your body that are covered by your underwear are private and not to be shown/shared when at school, or with friends. When he is at the doctors or changing, or bathing ,or going to the bathroom, that's the time when private parts come out, not in other circumstances.
Particularly for boys, this is just the time developmentally when this happens. Later, boys grow up and compare their cars!