Plz explain Boolean flag in more detail

I am having doubts about how to use boolean and what does that means in "if " that is showing flag = false.

flag will be a track of number is prime or not
my flag is true initially
after the while loop completion
flag is true that means. number is prime