This is a clear indication of attraction. Usually when a guy is looking at someone he is attracted to and that person catches his eye, he might feel like he's been "caught" so he'll look away quickly. If he had no interest in you, he either wouldn't be looking in the first place or would just keep looking if you caught his eye.
You've never done this with a guy? Any person? I've done this countless times with girls. When you are going through a daily routin, say school/work, and you catch an attractive girl, it is really, really hard not to stare. It's hard to catch a glimpse of a girl, that you can tell will be good looking, but not try to eye her anymore. Basically, he thinks you're good looking, and didn't want to stare at you xD