Όπως is "like, as, such as". Σαν is "like, as though" and σαν +subjunctive is "as if". Σαν can also be used with the meaning of "upon" (in the time sense). *Upon hearing the news, he smiled"="Σαν άκουσε τα νέα, χαμογέλασε"
More extensivelly: Όπως is used for similes (and σαν). He lives like a king=ζει σαν βασιλιάς, ζει όπως (ζει) ένας βασιλιάς. Do it like John=Κάνε το όπως (το έκανε) ο Τζον, κάνε το σαν τον Τζον. If a verb follows, όπως must be used and not σαν, unless the verb is in subjunctive where only σαν can be used (and expresses a non real simile, same as "as if") Μιλάει σαν να ήταν πρωθυπουργός=He speaks as if he were a president. You can't say Ζει σαν ζει ένας βασιλιάς, it's completely wrong (with the meaning of as, like, but you can with the meaning of upon, as described before). Also όπως must be followed by article (indefinite or definite, and nominative case). Σαν does not have to be followed by an article if it expresses a generic meaning (lke the king example above) and if you want to make a specific simile, you have to add a definite accusative article. He speaks like his brother=Μιλάει σαν τον αδερφό του, μιλάει όπως ο αδερφός του.