Actually the second amendment has two portions. It reads as:
A well regulated militia, being necessary to the security of a free state, the right of the people to keep and bear arms, shall not be infringed.
So we first have a part stating a well regulated militia is necessary for a free state. If you look into
United Stats code you'll find the definition of a militia:
(a) The militia of the United States consists of all able-bodied
males at least 17 years of age and, except as provided in section
313 of title 32, under 45 years of age who are, or who have made a
declaration of intention to become, citizens of the United States
and of female citizens of the United States who are members of the
National Guard.
(b) The classes of the militia are -
(1) the organized militia, which consists of the National Guard
and the Naval Militia; and
(2) the unorganized militia, which consists of the members of
the militia who are not members of the National Guard or the
Naval Militia.
So any male between the ages of 17 and 45 are legally part of the unorganized militia. This comes from the fact that in the beginning of this country there was no standing army as it was thought of as a threat to liberty. Our system here was akin to what Switzerland has to this day.
Going by only the first part, the preamble, of the amendment would still allow for every male between the ages of 17 and 45 to possess arms. But the second part of the amendment specifically states the right of the
people to keep and bear arms shall not be infringed. It doesn't say the right of a well regulated militia but specifically mentions the people. If you look at writings from our founding fathers you'll note that they believed in the right of every American to bear arms not just those in the militia.