Maximum Modulus Principle: let $D$ be a domain in $\mathbb R^2$,let $u:D \to \mathbb R$ be a harmonic function.Suppose $u(x,y) \leq M$ for all $x,y \in D$ then either $u$ is constant or $u(x,y)<M$ for all $(x,y) \in D$
If $D$ is simply connected then using the fact that $u$ is globally real part of a holomorphic function we can deduce this theorem using the maximum modulus theorem for complex analysis.What if $D$ is not simply connected ?
The Maximum Modulus Principle is a "local" property: If $u(z) \le M$ in $D$ and $u(z_0)=M$ for some $z_0 \in D$ then choose an open disk $B$ with $z_0 \in B \subset D$. $u = \operatorname{Re}(f)$ for some holomorphic function $f$ in $B$. Applying the Maximum Modulus Principle to $e^f$ gives that $u$ is constant in $B$.
Therefore both sets $A_1 = \{ z \in D \mid u(z) < M \}$ and $A_2 =\{ z \in D \mid u(z) = M \}$ are open. If $D$ is connected then $D=A_1$ or $D=A_2$. In other words, if $u(z_0)=M$ for some $z_0 \in D$ then $u$ is constant.