"Greatest" is highly subjective. If we just mean the most brilliant tactical/operational/strategic mind, there's no real way to know, and I suspect the correct answer was on a losing side somewhere; all the brainpower in the world won't help you if you're running some paleolithic tribal nation against folks with gunpowder. Even if you're Fuzzy Wuzzy. Maybe it's a Napoleon or Genghis Khan or Alexander or Julius Caesar, bu it's more likely someone they beat whose sheer genius was outmatched by numbers, technology, or sheer bad luck.
So let me throw out some name that I haven't seen mentioned yet:
Stonewall Jackson-Certainly one of the finest military minds on either side of the American Civil War. When Jackson lost his arm (a friendly-fire injury that would eventually lead to his death) Lee supposedly said "e has lost his left arm, while I have lost my right" and he later wrote to Jackson "Could I have directed events, I would have chosen for the good of the country to be disabled in your stead." That's high praise, but entirely deserved. His Shenandoah Valley Campaign, where he took 17,000 under-equipped men, marched 646 miles in 48 days and defeated three Federal armies totaling 52,000 men, is still renowned today. Of course, he was died from infection following the friendly-fire mentioned above in 1863, less than to months before Gettysburg. Lee supposedly believed that with Jackson at his side, he'd have won there. It's hard to get a real measure on Jackson's "greatness" per se, because his career in command was so short. Before the ACW he'd been nobody; just a minor artillery officer who left the army to become a professor at VMI. By the time he died he was a legend.
Belisarius is a good shout, but let me give you two other names from the Byzantine Empire: Emperor Nikephoros II Phokas, called "The White Death of the Saracens" (as in, he so terrified them that they went white with fear) and his stepson, Emperor Basil II Pophyrogenitos, called The Bulgar Slayer. These two were the most instrumental in bringing the Byzantine Empire back from the brink in the 10th and 11th centuries. Had Basil had better heirs (he never married, and left only a brother who had never held any real power, and a pair of nieces) it could have introduced a new Golden Age. The two pushed out Byzantine borders on all fronts and made the state inside them much stronger. Nikephoros pushed back he Saracens to a degree unseen since the rise of Islam in the 7th century, and Basil pushed them back even farther, in between boughts of combat with Bulgaria that eventually ended the Bulgar threat for a generation (the man spent most of his adult life in army camps, sometimes dashing back and forth between Bulgaria and Syria, crushing the Empire's enemies in both places). Basil also founded the Varangian Guard. But who still knows their names?
Turning to Rome, what about a winner who was always overshadowed? Augustus was the First Emperor. Augustus was, in many estimations, the best emperor. Augustus was a great conqueror, right? Well, no. Augustus wasn't a very good soldier. He was sickly and weak, too frail to have ever battled his way up the ranks. What he had were political connections, fabulous wealth (both legacies of his great-uncle Julius Caesar, of course), and a best friend who just happened to be one of the best generals Rome ever produced: Marcus Vipsanius Agrippa. Agrippa was of humble plebeian origins, his family were nobodies. But by luck, he was a classmate of young Gaius Octavius (the future Augustus). Any time you see in the history books that Augustus won a great battle, or waged some brilliant war, cross out Augustus and write in Agrippa. Agrippa was Augustus's red right hand, and deserves the credit for almost every military victory Augustus ever won. And "Augustus" won a fair few victories. Over Caesar's assassins, over Marc Antony, over the heirs of Pompey, and so on.
Scipio Africanus is another good one from Rome; the man who beat Hannibal.
Alfred the Great deserves a mention: not only is he famously the only English monarch to bear that sobriquet, but he earned it. He took a reeling Wessex, the last English kingdom standing against the Viking onslaught, and turned its fortunes around, pushing the vikings out of his kingdom and a significant chunk of the rest of England. In so doing he laid the foundations for the modern conception of England.
What about Rodrigo Diaz de Vivar, called El Cid Campeador, the iconic Spanish hero? Or Charles Martel, who turned the Moors back at Tours, saved Europe from the might of Islam, and laid the foundation for Charlemagne? Edward the Black Prince, whose victories at Crecy, Winchelsea, and Poitiers (among others) were some of the greatest English victories of the Middle Ages? Flavius Aetius, the man who turned back Attila the Hun? There's just so many choices.