Alright, I dug into the code some more and updated my answer.
Here are the number of kills needed for each level, taken from
Rookie Veteran Commander Legend
Squaddie | 1 | 1 | 1 | 1
Corporal | 5 | 6 | 6 | 8
Sergeant | 12 | 12 | 12 | 18
Lieutenant | 24 | 24 | 24 | 40
Captain | 38 | 38 | 42 | 70
Major | 57 | 57 | 60 | 110
Colonel | 81 | 81 | 85 | 175
However, there's more to it than just straight-up kills.
Every time a unit gets a kill, all the other units on that mission get partial-kills. The game calls these "
KillAssists", but that's a misleading name because the unit earns a
KillAssist whether or not they did any damage.
How much a "
KillAssist" is worth varies by class
(taken from DefaultClassData.ini, variable name
Specialist: 1/3rd kill
Psi Operative: 1/3rd kill
Rookie: 1/4th kill
Ranger: 1/4th kill
Sharpshooter: 1/5th kill
Grenadier: 1/5th kill
Additionally, Psi Operatives gets a kill bonus called a "
PsiCredit", worth 1/3rd kill, every time they are hit by Feedback.
Finally, if a unit started at any rank above 'Rookie', they'll have additional hidden bonus kills equal to the number necessary for that rank.
Assuming you obtained a unit at 'Rookie', you can see how many kills they have in the armory...
but without a save-file viewer (which doesn't exist AFAIK) you cannot view their
KillAssists. The best we can do is guesstimate from the number of missions.
In my screenshot above, if we assume she's encountered, say, 8 enemies per mission on average, then over 10 missions she's encountered
10*8=80 enemies. That gives her
80-29=51 KillAssists, which counts for
51/4=12 kills, bringing her approximate kill-total to
29+12=41 kills. So she needs around 16 kills or 64 KillAssists to level up to Major.
Edit: There is now a mod that shows KillAssists on the soldier info screen: Accurate Soldier XP
Some other interesting things I discovered while code-diving:
- Except for rookies, units only gain levels after actually getting a kill, so you can't have a Colonel with 0 kills.
- Kills are still kept track of after getting a promotion mid-mission, so people who claim "When a unit gets a promotion further kills are wasted" are incorrect. However, it is true that a unit can only gain one level per mission, even if they pass the threshold for two levels. In that case, they'll get promoted immediately on their first kill in the next mission.
- As of the latest patch, Wet Works (25% XP boost) is no longer retroactive.
PsiCredits are not boosted by Wet Works.
- Despite popular claims to the contrary, there is no XP in this game, it was disabled before the game's release (
bUseFullXpSystem=false). Though, I suppose you could consider
PsiCredits a form of XP...
- I've created a mod that gives a small number of kills to idle units (for technical reasons I can't add
KillAssists). There's an option to allow them to level up outside of missions as well.