Commander
From Starbase 900 Wiki
Commander is a rank used by the service organizations of many civilizations. On Earth, this rank has a history dating back to at least the 20th century to the old seagoing navies, and has equivalents used by numerous species and cultures on several planets.
In the Milky Way Galaxy, the modern rank of Commander is typically held by the first officers of various cultures' starships and is also granted to the commanding officers of the smaller outposts, space stations and starbases.
In Starfleet, a prerequisite to becoming a Commander is by taking the Bridge Officer's Test. As commanders prove their leadership ability over time, they are considered for the difficult and highly competitive promotion to captain.
Proper naval parlance says that, even if a naval vessel is commanded by an officer whose rank is Commander, that officer is still able to be referred to as a Captain while on the deck of their own vessel.