I don't know the law but logically the idea is like piracy. You see a pirate on the high seas you can shoot him. Even if he is your citizen. Piracy was an asymmetrical-war like crime that was very hard to eradicate, was more organized than most criminals but not a sovereign state where you could ambush their troops on sight if you had declared war. Just like terrorism. At least they don't assassinate terrorists inside the US, we like to not be like Somalia.