James Madison of Virginia (an original signer of the Constitution and the fourth President) is generally credited as being the "father" of the Bill of Rights. These rights include the 2nd. The state constitution of his state had the following in it on this matter...
"The right of the People to keep and bear arms shall not be infringed; a well armed and well regulated militia being the best security of a free country; but no person religiously scrupulous of bearing arms shall be compelled to render military service in person."
The right to bear arms was not dependent on being in a militia.
When the Bill of rights was adopted there was a good deal of concern about the potential threat that a standing professional army in the hands of a demagogue might pose. There was good reason for this concern. No one else had declared a separate Republic without a monarch before and filibusters and would be Emperors were fairly common. So the militias were thought of as a potential counterweight to that. When Coxe, Mason and others spoke of "the whole people" rising up it was with this in mind and not as a revolt of the people against a responsive and democratic government. There was concern that the states had neglected the militias as well. Nothing in the Constitution or Amendments to it made the rebellion of the Confederate States 60 or so years later legal.
Americans had a dismal view of large standing armies and were critical of the British use of such against them.
The English had attempted to disarm the people of Boston. One of the incidents that touched off the fighting of the revolution were British efforts to seize arms and ammunition in Lexington, Mass and Williamsburg, Va.
But long before the revolution the British colonists (Americans) considered that they enjoyed the British right to have personal arms. This wasn't a right that we held as persons and could not be taken away.
As we know the government at the time did deprive slaves, Indians, indentured servants, etc. from keeping personal arms. But the same made every effort to get them when they could.