How do you know if someone is flirting?

There's this guy at work.

I dont know if he likes me or is just being friendly.

I had to ask him a work question on Friday, he had to look at my screen & he was leaning really close to me.

In the morning & night he has to walk past my desk so he usually says good morning & good night & waves

On his way home tonight he did his waving thing then he stopped & smiled at me for what seemed like a while.

I don't know if I'm over thinking it.

How do I flirt back with him to see if he's keen?

How do you know if someone is flirting?
Post Opinion