If $G$ is a nilpotent group of class $2$, show $G' ≤ Z(G)$, and here we are taking the definition that class of nilpotency is the smallest length of the central series of $G$; where $G'$ is the derived group of $G$.
Now I have $1=G_0 \lhd G_1 \lhd G=G_2$ which is central so, $G/G_1 < Z(G/G_1)$ so $G/G_1$ is abelian. Then we have $G' \leq G_1$.
So we have $1=G_0 \lhd G' \lhd G_1 \lhd G=G_2$ but we don't know whether this is a central series or not!! So what to do next?
Sorry here I can't comment with this reputation, so any kind of short comment could not help me. Could you give me the answer with explanation?
From the definition of a central series you have that:
(1) $G_1 / G_0 \leq Z(G / G_0)$
(2) $G_2 / G_1 \leq Z(G / G_1)$
From (1) we see that $G_1 \leq Z(G)$ and from (2) we see that $G / G_1 \leq Z(G / G_1)$, which as you noted implies that $G / G_1$ is abelian and hence that $G' \leq G_1$, since $G'$ is the intersection of the abelian-quotient subgroups of $G$.
Putting it together you get $G' \leq Z(G)$.