The rule is a simple one and quite easy to follow. In theory like (a preposition) should be used only with a noun, a pronoun, or gerund.
You look like a princess. Be like your brother - start studying.
As, on the other hand, is a conjunction, and is used with a verb or before a clause containing a verb.
Why don't you walk to work as we do? As I told you, I left my coat at the office.
That said, why is it so easy for me (and others) to make this mistake time and again? In colloquial English people have been using "like" as if it were a conjunction for about 100 years. The Harper Dictionary of Contemporary Usage states that “probably no single question of usage has created greater controversy in recent years” than the conjunctive use of like. Why we have been switching like and as - that they did not explain.
Any rules of grammar you have difficulty adhering to?