What you were told is incorrect: neither sentence means what you were told. The sentence
$$\exists x,y~\forall z\Big((x\ne y)\land\big(C(x,z)\leftrightarrow C(y,z)\big)\Big)$$
says that there are (at least) two distinct students who take exactly the same classes: $x$ takes class $z$ if and only if $y$ takes class $z$. There may be any number of other students who also take exactly this set of classes; nothing in the sentence excludes that possibility.
$$\exists x,y~\forall z\Big((x\ne y)\land\big(C(x,z)\to C(y,z)\big)\Big)$$
says that there are students $x$ and $y$ who are not the same student and who are such that if $x$ takes a class, $y$ also takes that class. In other words, $y$ takes every class that $x$ takes, and possibly (but not necessarily) some that $x$ doesn’t take. This means, for instance, that we could not have just three students, $a,b$, and $c$, and three classes, $C_1,C_2$, and $C_3$, such that $a$ takes $C_1$ and $C_2$, $b$ takes $C_2$ and $C_3$, and $c$ takes $C_3$ and $C_1$: in that setup no student takes all of the classes that some other student takes.