For the rear takedown pin, do the fol:
1. Separate the upper form the lower.
2. Remove butt retaining screw from the lower (if its an A2 there will be a spacer inside the butt assy).
3. Remove butt assy.
4. You will notice a tiny spring protruding on the rear of the lower, remove it, and gently tap the return spring tube on something solid, and the detent should fall back (or out), (be careful not to loose it) so the takedown pin can then be removed.
5. On assy, do the reverse, paying attn to the slot in the takedown pin. It must line up with the detent. Be careful you don't mangle the spring when putting on the butt stock assy. The detent goes in pointy end first.
The AR is an armourer friendly weapon. Just go slow, and pay attention to detail. Its a simple job, and you should have no problems. Just takes a few minutes. Hope this helps you out.