The rank of a matrix can also be calculated using determinants. We can define rank using what interests us now.
The rank of a matrix is the order of the largest non-zero square submatrix.
See the following example.
$$$A=\left( \begin{array}{ccccc} 2 & 1 & 3 & 2 & 0 \\ 3 & 2 & 5 & 1 & 0 \\ -1 & 1 & 0 & -7 & 0 \\ 3 & -2 & 1 & 17 & 0 \\ 0 & 1 & 1 & -4 & 0 \end{array} \right)$$$
1) Given $$A$$, we eliminate rows or columns acording to the criterion to calculate the rank using the Gaussian elimination method. Thus,
Column $$5$$ can be discarded because all its elements are zero.
Column $$3$$ can be discarded because it is a linear combination of column $$1$$ and column $$2$$. Specifically, $$c3=c1+c2$$.
$$$A=\left( \begin{array}{ccc} 2 & 1 & 2 \\ 3 & 2 & 1 \\ -1 & 1 & -7 \\ 3 & -2 & 17 \\ 0 & 1 & -4 \end{array} \right)$$$
2) Is there any non-zero square submatrix of order $$1$$?
Any non-zero element is a non-zero square submatrix, therefore we will look at those of higher order.
Is there any non-zero square submatrix of order $$2$$?
$$$\left| \begin{array}{cc} 2 & 1 \\ 3 & 2 \end{array} \right| = 1 \neq 0$$$
Yes, there is, therefore we will look for higher orders.
4) Is there any non-zero square submatrix of order $$3$$?
$$$\left| \begin{array}{ccc} 2 & 1 & 2 \\ 3 & 2 & 1 \\ -1 & 1 & -7 \end{array} \right| = 0$$$
$$$\left| \begin{array}{ccc} 3 & 2 & 1 \\ -1 & 1 & -7 \\ 3 & -2 & 17 \end{array} \right| = 0$$$
$$$\left| \begin{array}{ccc} -1 & 1 & -7 \\ 3 & -2 & 17 \\ 0 & 1 & -4 \end{array} \right| = 0$$$
No, there is not. Therefore, rank$$(A)=2$$, which is the order of the largest non-zero square submatrix.