The 5.56/.223 caliber round in common use (55gr ball ammo) in fact penetrates LESS than a common 9mm handgun round inside a house or other structure. This is a FACT and if you actually had any sort of real experience with these weapons you would know this.
Ergo, you're not telling the truth
This is why, incidentally, SWAT and other police teams have gone to these weapons, in addition to the fact that it is quite common for drugged-up suspects to absorb several shots and keep coming. The common shotgun (that used to be the standard-issue police long-gun) is MUCH more dangerous in a confined space; a shotgun loaded with 00 buckshot (or worse, a slug) is FAR more likely to overpenetrate and injure or kill someone unintentionally beyond a wall or door (or for that matter in the next building!) than a 5.56/.223 weapon is.
Never mind the common AR-15 is NOT identical to the M4 issued to the military. The AR-15 is semi-automatic exactly as is the Ruger "ranch rifle" (which also fires the same cartridge); indeed, they are functionally identical weapons that only APPEAR different.
And both are safer in terms of overpenetration risk than a common 12ga shotgun.
Military weapons are typically select-fire -- that is, they can fire more than one cartridge with one press of the trigger (aka "machine guns".) Such weapons have been restricted since the 1934 NFA although under certain circumstances can be legally acquired.
You're obviously not a veteran as if you were you would know what a standard-issue military arm is, and that what's sold in the civilian market is NOT a "weapon of war."
More information about formatting options