I want to show that finite group $G$ is nilpotent iff for every maximal subgroup of $G$ like $M$ and $N$ , $MN=NM$.
Let $G$ be nilpotent. Since every maximal subgroup of $G$ is normal in $G$, the result is clear.
But for the converse I want to show every maximal subgroup is normal in $G$ but I don't know how to show it.
For the converse, suppose that $G$ has the property that every two maximal subgroups of $G$ permute. In particular, this implies that if $M$, $N$ are maximal subgroups of $G$ then $MN$ is a subgroup of $G$.
Let $M$ be a maximal subgroup and suppose that $M$ is not normal in $G$. Then $M^g \neq M$ for some $g \in G$, so $MM^g$ is a subgroup of $G$ properly containing $M$ and thus $MM^g =G$. But this is impossible since $HH^g$ is always a proper subset of $G$, where $H$ is a (not necessarily maximal) subgroup. Therefore, every maximal subgroup of $G$ is normal and thus $G$ is nilpotent.