Running from security guards is not illegal however if the security guard wanted to they could run after you and tackle you to the ground and then detain you until the regular police arrive.
However most security guards will not run after you unless you did something really bad and they will most likely just call the cops to look for you if the crime you committed was serious enough.
If you didn't do anything wrong though then running from a security guard will just make you look guilty of something.