Can this be used as a comparator? and how? Thanks
In a word yes. It's a voltage-feedback op-amp, so it shouldn't be a problem. But there are disadvantages in many op-amps (discussed here) - you'd be better off choosing a device specifically intended for use as a comparator. Unless your needs are very specific indeed.