Captain Smith and Captain Jones fly together today.
Who is in command...? On the flight plan, it says PIC = Smith...
Captain Smith is then the commander.
Or maybe that is the way they decided - "You fly out, I fly back...?"
Many different way airlines do. Seniority is another way.
xxx
When I worked in the USA, they called me "Captain X..."
In Belgium, or France, I was introduced as "Commandant X..."
In South America, I was at times "Comandante" - or "Capitán"...
xxx
Happy contrails