If a number has a factor other than one or itself, then it's not prime.

Basically
if number % otherNumber = 0 and otherNumber !=1 and otherNumber != number, then it's not prime.