I guess the number one question is why did you pull it out? Particularly pertinent as you don't know how to put it back in! The distributor/cam gears are helical which causes the distributor rotor to turn about 20 degrees as the gears mesh. Assuming you marked the distributor base and rotor positions prior to removing the distributor (you did, right?), position the rotor about 20 degrees from your rotor mark and with the base at the base mark press the distributor into place. It should be aligned with the
oil pump shaft as it was when you removed it. Start and retime.