Commands - Select entity not in volume [duplicate]
Solution 1:
You didn't specify why the solution in the linked post didn't work for you, but in 1.13 there's actually a better solution:
/execute as @a unless entity @s[x=…,y=…,z=…,dx=…,dy=…,dz=…] run <command>