The receiver extension gets thread into the lower receiver until the lip of it kisses the center of the buffer retaining pin.
In some cases, the bottom lip has to be faced back if you find that one wind back does not have the end of the tube kissing the post, while one wind more in will have the end of the tube lip binding on the center pin isntead.
As for new upper, start with cleaning it correctly, including using a chamber brush with CLP by hand to clean the chamber.
On the new B/C, pull the bolt off it, and with the carrier with carrier key only, dry fit it into the upper receiver. the key should not be binding on the upper slot.U channel in the charging handle, and when the front of the carrier gets about a inch from touching the back of the barrel extension, the gas tube will enter the carrier key so you can check the alignment of the two. If the gas tube needs to be re-indexed, then do so on the tube at the middle of the barrel. Hence when the gas tube is correctly indexed with the key, should be able to slide the carrier all the way forward tight against the barrel extension (part that has the feed ramps), tilt the muzzle up, and with the every so light of a shake, the carrier should slide all the way back. on the Bolt, pull the extractor and if you find a O ring around the extractor spring, removed it for safe keeping. Hence new extractor spring and O ring will put too much tension on the extractor, the extractor will not climb over the case rim correctly at loading, and will keep the bolt from locking up correctly. With the B/C cleaned and back together, hook a spend case on the extractor and cam the ejector into it bolt face channel a few times. The extractor should be under a lot of spring tension, but it should not be binding up in it channel at all as it being forced in and allow to spring back out.
Lastly, when you charge the rifle, do not walk the charging handle forward!!!! The B/C needs to run full speed from the rear to allow it to strip the round and lock the bolt up correctly. Hence bolt is locked up correctly with the face of the carrier is tight against the face of the barrel extension.