The answer to your question ultimately lay with the two consuls elected each year. They were the chief executive officers of the state somewhat like president and vice president in America. They directed the senate and had control of the military forces, a command which rotated each month between the two. If a certain theater of war, say Cisalpine Gaul, required action, then a resolution was passed by the senate with regard to how many forces could be used in the campaign, and the presiding consul would take the command.
If a war should drag on like many did, the consul usually became a proconsul with his imperium extended, and for the new year two new consuls were elected.
Governors of provinces or praetors also had a more limited command of forces located in a given province, but their imperium was localized to those borders unlike a consul.
At a lower level, military tribunes are also elected by the people, and they have officer duties within an assigned legion on par with that of a legatus depending on experience. Usually used as a way to give aristocratic youth some command experience.