Naa’imur Zakariyah Rahman, 20, from Finchley in north London, intended to attack the prime minister with a knife or a gun.
His plot was discovered after he contacted an FBI agent posing as an IS official online.
The FBI agent introduced him to an MI5 role-player, and Rahman began to reveal his ideas.
“I want to do a suicide bomb on parliament,” he said. “I want to attempt to kill Theresa May.
“There are lorries here with big gas tankers. If a brother can drive it next to parliament I will bomb.”
He also spoke about using a suicide belt, a drone, an improvised explosive device and poison, referred to as “P” or “curry mix”.
He told an undercover officer: “[God willing] will be very big if I’m successful. I can’t mess up. I can’t get [martyrdom] if I get caught.”
The trial heard how Rahman came to police attention when he was arrested on suspicion of sending indecent images to underage girls in August last year, but not charged.
Officers became concerned about potentially extremist views after examining his mobile phone.
Rahman had been encouraged to take action by an uncle who travelled to Syria and was killed in a drone strike last June.
After his uncle’s death, he became more determined and went online for inspiration, unwittingly getting in touch with the FBI agent.
On 18 November last year, Rahman carried out reconnaissance around Whitehall.
He bought a rucksack from Argos two days later, before meeting an undercover officer in Brixton.
He thought the officer was going to fit the rucksack with explosives.
It was in fact filled with dummy explosives and replica pepper spray, and handed back on 28 November.
Rahman told the officer he was “good to go” but was arrested as he walked away in Kensington carrying the fake bomb.
He was found guilty at the Old Bailey of preparing acts of terrorism in Britain.
Midway through the trial, Rahman admitted helping his friend Mohammed Aqib Imran to join IS in Libya by recording an IS sponsorship video.
Imran, 22, from Birmingham, was convicted of possessing a terrorist handbook.
The jury is still deliberating on a charge against Imran of preparing terrorist acts abroad.