Generally when pilots start at airlines, they are first officers. Then since airlines use seniority systems for pilots, pilots can eventually bid for an upgrade to captain. Becoming a captain requires taking a course that lasts several weeks, and then passing some tests.