It all began when James volunteered for the British Army as an entertainer -- the army was so impressed by his talents that they assigned him to the Pay Corps instead (the guys in charge of paying soldiers). The Aussie, however, was eager to contribute his acting abilities to the war effort, so he signed up for the Pay Corps Drama and Variety Group. It was there that he began performing his impression of Montgomery, which was apparently the highlight of the show.
James' resemblance to Montgomery got him the attention of MI5, who saw in him the perfect opportunity to troll some Nazis. James was flown to London and given the mission to pass himself off as Montgomery in other countries to make the Germans think the Allied invasion would be coming from Southern France, not Normandy. In order to immerse himself in the role, James followed Montgomery for a while, stopped smoking and drinking (the general was abstinent) and even started using a prosthetic finger, since Montgomery had lost a finger on his right hand in World War I.
No, we don't know if it was the middle one. But we think it's pretty safe to just assume that.
With his training complete, James was sent to Gibraltar in Winston Churchill's private plane and began attending parties as Montgomery, running off his mouth about made-up plans in the general proximity of known Nazi spies.