he definitely needed to cap him. as soon as the robber sees security he points the gun directly at the guard, at that point, he's just put the guard's life in danger making it self defense.
the sad thing is the gunman isn't holding the place up for money, it's a pharmacy and he's holding it up for pills. He's a fucking drug addict.
I think it would be more profitable to steal a bag full of pills than a cash that gets emptied every few hours?