During the Apollo era, Deke Slayton, as chief of the astronaut office, was the primary decision maker when it came to choosing who was assigned to which crews. Slayton was chosen for the Mercury program but was grounded due to a heart issue. Since he had been through astronaut training, but wasn't in competition for a mission assignment himself, he was widely trusted as an impartial judge of astronaut qualifications. (Slayton was restored to flight status in 1972 and flew on the Apollo-Soyuz Test Project mission.)
Slayton actually started this process at the beginning of the Gemini program, taking into account the plans for Apollo in deciding how many astronauts to hire and how to train them. During the program, Slayton didn't reveal all the details of his selection process; he wanted the astronauts to excel overall rather than giving them ways to game the system. Some observers have suggested the opaque evaluation process was discouraging to some of the astronauts, or that it gave Slayton cover to play favorites.
Since then, in his autobiography, Deke!, he's given somewhat more insight into the process. Regarding how candidates were selected to join the space program, he writes:
I had already developed a point system that we used in making the final evaluations on astronaut candidates. There were three parts: academic, pilot performance, and character/motivation, ten points for each part, with thirty being the highest possible score. Some of it was cut-and-dried: you got points for a certain amount of flying time and for education. Some of it, by design, was subjective and based on face-to-face interviews.
As for crew assignments, he says:
- Everybody was considered to be qualified and acceptable for any mission when brought into NASA. That is, if I hired the guy and kept him around, he was eligible to fly.
- But some are more qualified than others for specific seats on specific missions. That is, guys with command or management or test pilot experience were more likely to be handed the more challenging assignments.
- I would try to match people in a crew based on individual talents and, when possible, personal compatibility. But I didn’t give nearly as much weight to the compatibility issue as everybody thought, because it wasn’t necessary. Everybody in the astronaut group was talented and motivated, or they wouldn’t have gotten there in the first place. They were likely to get along no matter how they were matched up. On the other hand, matching people where possible made life easier all around, and added some fun.
- I always kept future requirements and training in mind. When I wanted somebody for an assignment in Gemini, I had to think how that would affect Apollo. So I had a long-term plan that was updated regularly.
- I assumed a ten percent annual attrition rate for all causes—accidents or resignation. (This was a wild-assed guess I made in 1963 that turned out to be pretty close.)
He and others in the astronaut office evaluated every astronaut's aptitude and dedication to the program. From this information, and the constraints of the missions, Slayton assembled crews that he thought were likely to perform well. In late 1964, after having already put together a tentative slate, Slayton also asked for a round of peer reviews:
I got the thirteen remaining guys in the third group together and gave them a little job. Each guy was to exclude himself and rank the others in the group in the order he thought they should go into space. We had done the same thing in Mercury.
...
These guys knew each other’s abilities better than anyone, and they were pretty objective. The ones who came to the top of the peer ratings were pretty much the ones I had assigned to the later Gemini missions.
Each Apollo crew consisted of a commander, a lunar module pilot, and a command module pilot; the commander and LMP would land while the CMP stayed behind with the CSM in orbit. Commanders for Apollo were all selected from astronauts who had already flown at least once before during the Mercury or Gemini programs. The early Apollo flights had experienced astronauts as CMP as well, but for Apollos 13 through 17, the CMP and LMP were all rookie astronauts on their first space flights.
Each crew of 3 was assigned at the same time, and to the extent possible the crews were kept together. If a problem cropped up before a crew had begun intensive training for their next mission, the whole crew might be pushed back to a later mission (for example, Alan Shepard's crew got pushed from Apollo 13 to Apollo 14 to give Shepard, recently restored to flight status, more time to train). Each Apollo mission had both a prime crew and a backup crew. The backup crew would train for the mission alongside the prime crew and an individual from the backup crew might move up to the prime crew if a prime crewman was taken out of the running later in training (as happened during the run-up to Apollo 13, when Ken Mattingly was exposed to measles, and backup CMP Jack Swigert took his place).
Normally, the backup crew for a given mission would expect to skip the next two missions and be assigned to the following mission as the prime crew, although as often as not some change would be made over that time. The backup crew for Apollo 11, for example, was Lovell/Anders/Haise, so Lovell's crew was in line for Apollo 14; the assignments for Apollo 13 and 14 got switched, and Anders left NASA, so Ken Mattingly wound up in the prime CMP slot on 13.
It might seem that command module pilot would be the less desirable role, but a good performance as CMP would put an astronaut in line to be a commander on a later mission, so there was plenty of incentive to excel in the CMP role. The pattern was that a good CMP would be assigned as the commander of the backup crew on the third following mission, and the commander of the prime crew on the third mission after that. For example, Jim Lovell was CMP on Apollo 8, backup commander for 11, and selected as commander of 14 (before that crew was shifted to 13), David Scott was CMP on 9, backup commander on 12, and commander on 15, and John Young was CMP on 10, backup commander on 13, and commander on 16. Apollo 12 CMP Dick Gordon was backup commander for 15, but the program was cancelled and he lost his chance to command 18.
It wasn't until quite late in the process that it was clear that Armstrong and Aldrin would be the first to land. Prior to his death in the Apollo 1 fire, Gus Grissom probably had the best chance at it; Slayton and MSC director Bob Gilruth agreed that "if possible", one of the Mercury astronauts should get the opportunity. The Armstrong/Aldrin/Collins crew was assigned to Apollo 11 after Apollo 8 had flown; while it appeared at that point that 11 could be the first landing, any severe problems that cropped up with the spacecraft or the process on Apollo 9 or 10 could have delayed the landing to Apollo 12 or later. Some people in the program argued for attempting a landing with Apollo 10, but others, including the commander of that mission, Tom Stafford, felt that a "dress rehearsal" flight was the better option.
At the end of the program, there was pressure to put a scientist on an Apollo crew, so test pilot Joe Engle was bumped from the LMP slot on Apollo 17 in favor of geologist Harrison Schmitt. Schmitt became a qualified jet pilot after joining the program, but it's worth noting that the role of the lunar module pilot is more of a systems-operator or engineer position than a hands-on-joysticks job.