Usaamah Rahim had been under 24-hour surveillance at the time of the shooting and authorities said they believed he was planning a mass attack on police.