Sorry to hear you're struggling.
I have a 2 year old too, and we've been finding it tricky with the hitting. While she's currently an only child, and it's only ever me, it's been in response to any little thing I say which isn't "of COURSE you can".
It's been going on for a while and I'd also given each of the above a good go. The thing that's finally calmed things right down is removing myself.
"I'm going to leave the room now to keep myself safe. I will not let you hit me".
Then I leave. She immediately chases me and says sorry and strokes whichever bit she hit.
Quite often now, if she does hit, she'll say sorry before I've even opened my mouth.
It's reduced a lot over the last few weeks and things are definitely easier. Beforehand she'd just chase me down to keep hitting me.
As she's gotten older I've also found it easier to discuss things with her. Not in the moment but at other times. She'll tell me someone hit her at nursery. I'll say "oh no, how did you feel when that happened?" And she's able to tell me how sad she felt. I've then been able to explain to her that using our hands to hit people makes them really sad and isn't kind at all.
So on the odd time she's hit me lately, it'll be a few hours later when it's long forgotten and she'll come and tell me how she'd made me sad by using her unkind hands and that she's sorry again.
Obviously the understanding comes with age and at the moment their feelings are big and their coping skills for them are small. So in the meantime, moving away when possible can be the negative effect they need.
I also make a huge deal out of her kind hands. Every kiss or cuddle gets full attention and "oh wow, thank you for being so kind. It's made me SO happy!!" And that positive reinforcement went alongside things.
It gets easier, I promise. Just stick with whatever thing you try and that boundary will eventually hold!