The second amendment is a well regulated militia being necessary to the security of a free state, the right of the people to bear arms, shall not be infringed.
The third amendment is no Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to be prescribed by law.
The first amendment is the right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.
The british sent in troops called the red coats to scare them and to enforce laws so for protection they made it legal to bear arms for protection.
The british forced the colonists to house there soldiers during the time, so to make it so something like that never happened again that made it so no one can be forced to have someone live in there house.
The british searched areas and searched houses without permission at any time or anypoint without a reason or with a reason they did what they wanted which now there has to either be a reason or a warrant.