Here is another way to do this, which shows that we also do not need the operation to be associative, as long as we instead require the following property (which is also satisfied by groups):
For all $x,y\in G$ there is a $z\in G$ such that $x = zy$ (or such that $x = yz$, either one will suffice).
Now, if the operation is not commutative there will be two elements $a$ and $b$ such that $ab\neq ba$. But there is some $c$ such that $ab = ca$ (by the above property with $x = ab$ and $y = a$). Since we cannot have $c = b$ this breaks the assumption that whenever we had $ab = ca$ we would have $b = c$.
A bit more about the property I assume here, to "demystify" it:
To make the property a bit more natural, it might help to see a slightly different way to define a group: We start in the usual way with a binary operation that is associative and has a unit. But as an alternative (though it is equivalent) to the inverses, we require that for each element $g\in G$ both left- and right- multiplication by $g$ is a bijective map (I leave it as a nice exercise to show this is indeed equivalent to the usual definition).
Now, the property I assume here can be restated as: For each $g\in G$, right multiplication by $g$ is surjective (or very shortly just $Gg = G$ for all $g\in G$).
As noted in the comments, the condition is essentially "half" (or maybe closer to a quarter of) the property required for having a quasigroup (if we just keep the property that both left- and right- multiplication by any element is bijective and remove associativity and unit, we get to what a quasigroup is).