Formal assessment, with plenty of interviews, technical and non technical, psycho evaluation, assessment flights and assessment sims.
After this, if the command board thinks you are good enough, off you go for the command course, which is also no joke.
In the best case scenario it takes about 1,5 years from the start of the process, which cannot start before 6 months of employment.