Roman legionaries had to be Roman citizens under the age of 45. They enlisted in a legion  for twenty-five years of service, a change from the early practice of enlisting only for a campaign. The last five years were on veteran lighter duties (situation after Marian reform).

Recruits

Tiro (recruit). He was not yet subjected to full rigors of military discipline untill he passed out (I guess that means "graduated") and was registered as a real soldier, no regular pay so presumably living of his enlistment bounty or viaticum.

Lower ranks

Miles (private) also: munifex (fatigue worker) or gregralis / gregarius (literally: herd animal)  (Means a herd, or comrade, not necessarily a herd animal). He was on basic pay and eligible for fatigue duties. Legionary cavalrymen had higher basic pay, as did their NCO’s due to the higher cost of equipment and may have had immunis status (lots of endless debate about this.  They got extra money to pay for feed for their horses, and had to tend and groom them in addition to their regular duties, but didn't necessarily have to do the same digging, etc. that an infantryman did.) as a rule, though this is not certain.

Discens (trainee). Private in training for special function, basic pay and eligible to fatigue duties. (I have not heard this term)

Immunis (immune (from fatigues)). Attested from the second century AD onwards, the late first century opera vacans may have been an earlier designation for the same position. Specialist with basic pay and immunity from certain fatigue duties, could apparently be granted this status both indefinitely and temporarily as one inscription lists an immunis perpetuus. (People like master carpenters, blacksmiths, accountants, doctors, etc., who were not risked in regular battle lines)

There is a lot of confusion regarding rank and function in the Roman army. Some specialist positions could be held by men of various rank (eg exercitator or cavalry instructor) and this has led to some authors assigning NCO status to all men holding a specialist position, even in cases that this cannot be confirmed by direct evidence. It is important to be weary of functions that could be held by privates, NCO’s and subaltern officers alike.  

Non commissioned officers (This is a modern distinction, really, Centurions and Optios, signifers, etc., weren't considered officers by what I've seen, though they frequently wore the sword on the left side, to distinguish them from regular line soldiers, and of course, had different functions in the line.  AFAIK, it makes us comfortable to thing of the Centurion as a "First Sergeant", but that's not really accurate.  There isn't any corresponding modern rank for these guys)

Sesquiplicarius (NCO on basic pay and a half). Junior NCO. Example: tesserarius (NCO in charge of watch words) and vexillarius or vexillifer (flag bearer).

Duplicarius (NCO on double basic pay). Senior NCO. Examples: optio centuriae (rearrank officer), signifer (standardbearer), cornicularius (administrator), aquilifer (eagle standard bearer). Epigraphic evidence for career structures does not allow to distinguish a coherent system of promotion between these first three different duplicarius functions, so perhaps there were either frequently changes in status between the three of them or all three were of identical seniority. Note that optio (‘chosen man’) could also be used for mere privates with special duties rather than real NCO’s leading to some confusion in determining career patterns.

Triplicarius (NCO on triple basic pay). Senior NCO. Evidence for this rank is very rare and it may have existed for only a brief while.

Salararius (salaratus). Some soldiers with special skills served against non standard service conditions, either as mercenaries or reenlisted veterans, and received salaria instead of regular stipendia, a special rate of pay.

Duplicarii and sesquiplicarii combined became known as principales from the second century AD on. Cavalry NCO’s received double the higher cavalryman’s basic pay (stipendia equestria). Discharge benefits, praemia or commoda, and special bonuses, donativa, followed the same rates as basic pay.

Subaltern officers

Centurion (‘commander of hundred’, officer in command of a centuria  [common misconception:  the word does not come from the number, but is a participle of the word for "count"--census.  Only 80 men as we know, plus the various -ifers attached to the century] ) also ordinarius or title derived from original place in the battle order. There was some variation in seniority and remuneration between these officers. Those with prior in their titles (hastatus prior, princeps prior and pilus prior) led the manipuli with officers with posterior in their titles (hastatus posterior, princeps posterior and pilus posterior) acting as deputies. Pili could also be named triarius, though this was very rare under the empire (one certain case, one possible). It is thought that the pilus prior was in command of a legion’s cohort. Pay for all these officers was at least fifteen times that of a ranker. The socalled primi ordines, the centurions of the first cohort, had much higher status and pay (estimated at at least thirty times basic pay) than the other officers. The primus pilus was the most senior centurion and received 60 times basic pay plus entry into the equestrian order after completion of his stint.

In addition to the 59 or 60 ordinarii (those actually commanding an ordo or centuria of the legion) there was an unknown number of supernumerarii attached to each legion. These officers had special functions in the legionary cavalry, military intelligence, medical service, elite legionary infantry and various other postings in the governor’s staff or imperial horse guards.  (I'd have to see some citations from a real historian to buy into this.  Sounds like rationalization to me.)

The centurions were either equestrians or curiales directly commissioned from civilian life or had started out as buck privates and earned their position by serving in NCO postings in the legion or the imperial praetorian guard. Directly commissioned equestrian officers may have had different pay as they received salaria instead of the usual stipendia. Note that there were, as far as can be established with our present sources, no decuriones for the imperial era legionary horse in contrast with the republican legion. Apparently these cavalrymen were now commanded either by centurions or NCO’s. (I'd have to see some citations from a real historian to buy into this.  Sounds like rationalization to me.)

Senior officers

Tribunus. There were six of these officers to a legion and usually there were five equestrian tribuni angusticlavii and one senatorial tribunus laticlavius, named thin – or broad striped after the purple lines on their tunics that indicated their social status. The last one was had higher status and functioned as second-in-command of the legion. The equestrians were generally career officers with previous commands over auxiliary foot regiments, for senatorial youths this was often their first post. Some tribuni served only six month tours rather than the more usual 1-3 years. A few served two or even rarer three stints of duty. Though modern works often ascribe these officers purely administrative tasks, the source material indicates that these had by no means replaced their tactical command function.

Praefectus castrorum. This camp commandant usually had held the post of senior centurion and was in charge of a host of tasks. (No, the senior centurion, or Primus Pilus, was a centurion.  The Praefect was a separate person with considerable authority. ) Of equestrian status, he was third in the chain of command, except in Egypt and later also in special circumstances when this officer acted as praefectus legionis, sometimes with the additional designation agens in vice legati, acting in place of a legate.

Legatus legionis. A senatorial officer who generally had seen prior service as tribunus and was placed in charge of the legion. Some special cases included equestrians elevated to senatorial status with previous commands in the auxilia.  (Regardless of whether he was equestrian or senatorisl, he was appointed by the Senate, and was a big cheese.  No generals are listed in this group.  Why not?  They existed, and were part of the war room staff.  The generals would be assigned to various groups of cohorts, legions, or whatever function the Legate decided.  And they had influence over decisions up to a point.  Think Marcus Antonius when you think general, during the period of time when he had not yet gone to war with Octavian.)

II. Auxiliary rank structure

Roman Auxiliary - Roman military ranks

Roman Auxiliary

Auxiliaries (helpers) were supporting troops in Roman army. Their members were recrited from non Roman tribes and nations.  (Non Citizen soldiers)

Auxiliary rankers, NCO’s and subaltern officers  
Generally the same as for the legions. (All true, except sometimes a Legionary Centurion might be installed for whatever reason, or so I've read.)
The equites cohortales, cavalrymen attached to a cohors equitata, an infantry formation with organic cavalry component, had higher status and pay then the foot soldiers, but inferior to that of the equites alares, the troopers of the cavalry regiments. A peculiarity of auxiliary cavalry noncom titles is that they were often just named after their pay grade rather than their function. (Pretty much all cavalry were auxilia.  After the early Republic, the cavalry were hired and enlisted from non-Roman sources.) Auxiliary cavalry turmae (Turma is a late Roman term, the earlier cavalry were called "Ala, Alae"--wings, probably because they were generally stationed on the flanks.) were led by decuriones, who were of similar rank to infantry centuriones. Some similar type of ranking structure may have existed for auxiliary decuriones and centuriones, but surviving details are sketchy. Since there were auxiliary ordinarii perhaps some auxiliary units had supernumerary officers as well. Auxiliary infantrymen received either five sixths or equal amounts compared to the pay of legionaries, cavalrymen received more. Cavalry is not attested as having built anything themselves, so perhaps they had all status of immunis or were excused certain types of menial tasks. Many auxiliary noncoms and subaltern officers were either transferred legionaries or otherwise Roman citizens rather than peregrini (freeborn unenfranchised provincials). (Lots of perhapses.  I don't think we know all that for the early period.  Maybe more for the Late Romans.)

Auxiliary officers

Praefectus cohortis. Commander of an infantry unit or infantry unit with organic horsemen. Usually the first post in the equestrian military career (tres militiae) and for some the last, it appears to have been of equal status and remuneration as the legionary centurionate. Men with good service records or influential friends could go on to a legionary tribunate or post of tribunus cohortis. A post of subpraefectus is known from the early principate, though its precise details are unclear.  (Not sure of this.  Those offices were usually reserved for citizens, afaik)

Tribunus cohortis. Commander of a unit originally raised from Roman citizens or of milliary (thousand strong) strength. Usually a second post in the equestrian military career.

Praefectus alae. Commander of a quingenary (five hundred strong) cavalry regiment. Usually the third post in the equestrian military career, though for a short period the second. The post of praefectus alae of a milliary unit brought great prestige and was the extraordinary militia quarta (fourth post in equestrian army career).

Most equestrian commands lasted 2 to 4 years, though it could in some cases be held for 10 years or more. For most equestrians military serice seems to have been a professional career, though others only opted for a short military term in an otherwise civilian career. Some equestrian’s opted for a legionary centurionate rather than an auxiliary prefecture, which is thought to have offered more secure employment.  (I really doubt this, but it could be true.  The citizen legionary would not likely have submitted to a non-citizen as a centurion, and a mounted "noble" Roman would likely not have gotten down in the mud with the grunts.).  

III. Preatorian rank structure  (I have no idea about Praetorians)

Roman Praetorian - Roman military ranks

Roman Praetorian

Praetorians were guard of Roman emperors. Preatorians were the only military units allowed to stay in Rome.

Milites. Regular soldiers of the guard.
Immunes. Guardsmen with secondary specialist roles that exempted them from other less than desired duties. After five years these soldiers were allowed to serve in the Equites singulares (cavalry branch).
Evocati. After 16 years of service guardsmen could retire with a sizeable cash payment. Guardsmen who chose to stay in service after the 16 year period were called Evocati and gained privileges.
Centuriones. Praetorian Centurions commanded centuries of guardsmen while the most senior centurions commanded entire cohorts.
Tribuni. These officers acted as staff officers and as deputies to the Praetorian Prefects.
Praefectus. The highest rank in the Praetorian Guard, head of the Praetorian Guard.