In 1793, 'Militia' meant every man old enough to lift and load a musket, regardless of whether they had ever served in the Regulars or been trained at all. 'Well regulated,' while an odd choice of words by modern standards, meant 'Equipped' and encompassed that they really ought to know how to shoot, either with their own weapon on hand or standard weapons issued out from the armory in crisis times. The gist is that Congress should not be allowed to hinder that by restricting weapons ownership to a limited class such as just people who were actually getting paid by State or Federal governments, i.e. standing regular armed forces, which the Founders viewed with a certain amount of understandable skepticism, given their own experience with England.
10 USC 311 makes all able-bodied men, citizens or those pending citizenship, between 17 and 45 members of the Unorganized Militia, whether they have ever served and received training or not. However, it is more narrow than what the Founders or the Second Amendment are talking about, and only dates back a hundred years, to the dawn of World War One.