He may act nervous and stare whenever he sees you because he may be attracted to you and may really want to talk to you at that moment but he is too shy to do it.
He keeps thinking about what he should say or how he should go about approaching you.
Unfortunately, the more he thinks about this without taking any action, the more nervous he becomes.
Eventually, all he can really bring himself to do is stare because he is frozen with the fear and trepidation that comes with approaching a girl that he really likes for the first time.