The only person you can set boundaries for is you. You cannot control another person's behaviour. So, setting a boundary does not look like "If you hit me I will leave you" - instead it looks like "if he hits me I must leave". You should clearly communicate your boundaries but you they are your boundaries not anyone else's.