Hitting

My 18 month old has started randomly hitting. He’ll only hit me, occasionally the dog, but never my husband. We have tried everything:telling him no, walking away, time out chair, pretending to cry. I’ve taken his hand before he hits me and rub it against my face and say “nice!”. I don’t know what else to do. I’m sure it’s just a phase but I don’t want him to think it’s okay to hit me. And I know it won’t get fixed overnight either. Any other advice? I will never hit my son back so please don’t even suggest that.