If you're not trying to "pass" as non-autistic, do whatever feels comfortable and appropriate to you.
If you're trying to do what's socially normal, I can tell you this is a great topic. Many people, aspies/auties and NTs alike, don't realize that other people are looking at them when they're walking past.
What you're "supposed" to do is look at a target (where you're going, usually), then when someone is in your line of view, you glance at their face. If they're looking at you, you make eye contact for maybe 1 second, smile SLIGHTLY, then look away. Sustained eye contact means that you're threatening or sexually attracted to the other person. Usually you don't want them to think either thing, lol!
There is something in aspie/autie eye contact that makes NT people comfortable, so that's another reason not to sustain eye contact. NTs usually explain it weird ways, but what's actually happening is that autistic people are using fewer tiny movements in their facial expressions and also focusing on different things when they look at another person. NTs look "into" the eyes, whereas aspies/auties look at the broad features. Are the eyebrows scowled or surprised? What's the mouth doing? That kind of thing.
Sorry if that was too much information. This topic fascinates me!