"A well regulated militia, composed of the body of the people, being the best security of a free State, the right of the people to keep and bear arms shall not be infringed, but no person religiously scrupulous shall be compelled to bear arms."
(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, Federal law defines the militia as being the entire population of the US with a few notable exceptions. Therefore, the 2nd Amendment applies to individuals. It ain't rocket science.