Your intuition is correct. The number of $0$'s on the main diagonal is equal to the dimension of the kernel of the matrix. It is clear that any square matrix can be diagonalized when using both row and column operations. It is also clear that the non-zero entries on the main diagonal can then be normalized to $1$.
Now, if a matrix $B$ is obtained from a matrix $A$ by performing row operations, then $B=PAP^{-1}$ for some matrix $P$. The kernel of $B$ is then precisely $P(Ker(A))$, and (as $P$ is invertible) the dimension of the kernel of $B$ is equal to the dimension of the kernel of $A$.
A similar argument works for column operations. It now follows by induction on the number of operations performed that if $B$ is obtained from $A$ by performing any finite number of either row or column operations, then the dimension of the kernel of $A$ is equal to the dimension of the kernel of $B$. In particular then, if $B$ thus obtained is diagonal, then the dimension of its kernel is clearly equal to the number of $0$'s on the main diagonal, which is thus equal to the dimension of the kernel of $A$.
This is a baby version of Sylvester's Law of Inertia.