If you are using a stamped receiver and no foreign muzzle device, you need 5 US parts. With foreign muzzle device, 6 US parts.
Milled receivers only need 4 US parts if you are not using a foreign muzzle device.
You can have no more than 10 foreign parts in the rifle, including trunnions, for it to be considered a US rifle.
If I've missed anything, I'm sure someone will add it.
A domestically produced sporting rifle may have no more than 10 imported parts for it to still be considered domestic. So, depending on whether you have a milled or stamped rifle and whether or not it has a muzzle brake, you will have to replace up to 6 of the imported parts with made in the USA ones.
That's a key phrase there. You can't just slap on some US doohickies and go. You have to replace parts that were on the original rifle with made in the US ones. That's why it works in our favor that the butthole stocks are counted as 2 parts during the parts count for importation. If it were only counted as one part you would be adding another part to the total count when you put a pistol grip on. It could easily be offset by adding a US pistol grip, just like a made in the US muzzle brake will, in effect, offset itself but it would add an additional twist to an already convoluted subject.
Replacement US parts include:
Buttstock 1
pistol grip 1
upper and lower handguards 1
muzzle brake 1
gas piston 1
hammer 1
trigger 1
disconnector 1
magazine body 1
follower 1
floorplate 1
reciever 1
Please note that the upper and lower handguards are counted as one part. If you only replace one or the other it will not be counted as a US part regardless of what is molded into the plastic. Both the upper and lower must be of US manufacture for it to count toward changing it's import status. Also, a muzzle nut is not an attachment if it is secured properly but a brake is an attachment regardless of whether or not there are threads holding it on.