If we know the rank of a matrix r, can we assume that will have precisely r non-zero eigenvalues?

I have looked at many answers on the internet regarding the relationship between rank and eigenvalues, and all of them contain complex calculations and descriptions too advanced for me, a beginner student of linear algebra, and do not really answer my question at hand, which is : is it possible to precisely determine the amount of non-zero eigenvalues of a matrix A simply by its rank r? There is a question in my textbook and vaguely alludes to this being the case, but it never actually goes into detail about the relationship between rank and eigenvalues.

Consider the identity matrix in $$3$$ dimensions. It has rank $$3$$, but the characteristic polynomial is $$(1-\lambda)^3$$, which only has one root $$\lambda=1$$ of multiplicity $$3$$.
The matrix will have exactly $$r$$ non-zero singular values, but not necessarily $$r$$ non-zero eigenvalues.
Consider the matrix $$A = \begin{bmatrix}0&1\\0&0\end{bmatrix}$$. We have $$\text{rank}(A) = 1$$, but both eigenvalues of $$A$$ are $$0$$.
Supposing that the matrix is square and admits an eigendecomp then you would have $$r$$ eigenvalues right but there matrices with rank $$r$$ that aren't square and have $$r$$ singular values.