Illegal describes a person not permitted to be in a country or an act that is against the law. (adjective)
An example of illegal as an adjective is the phrase an illegal person, who is someone who is still in the United States after their tourist visa has run out.
An example of illegal as an adjective is the phrase an illegal act, which is an act such as armed robbery.