Say, $A = \begin{pmatrix} a_1\\ a_2\\ ...\\ a_n \end{pmatrix}$ and $B = \begin{pmatrix} b_1 & b_2 &... & b_n \end{pmatrix}$
where, $a_i, b_i \in \mathbb{R} $ for $1 \leq i \leq n$ and all $a_i,b_i$ should not be zero because these are non-zero matrices. Now,
$AB = \begin{pmatrix} a_1b_1 & a_1b_2 & ... & a_1b_n \\ a_2b_1 & a_2b_2 & ... &a_2b_n \\ ... & ... & ... & ... \\ a_nb_1 & a_nb_2 & ... &a_nb_n \end{pmatrix}$
Now, you can write each column here as:
$b_1\begin{pmatrix} a_1\\ a_2\\ ...\\ a_n \end{pmatrix}, b_2\begin{pmatrix} a_1\\ a_2\\ ...\\ a_n \end{pmatrix},…,b_n\begin{pmatrix} a_1\\ a_2\\ ...\\ a_n \end{pmatrix}$
So, here, all the columns are multiple of $\begin{pmatrix} a_1\\ a_2\\ ...\\ a_n \end{pmatrix}$
So, maximum number of linearly independent vectors in column space $\mathbb{R}^n$ is $1.$
Similarly, you can see all the rows are multiples of $\begin{pmatrix} b_1 & b_2 &... & b_n \end{pmatrix}.$
So, maximum number of linearly independent vectors in row space $\mathbb{R}^n$ is $1.$
Hence, rank(AB)=1.
Another way might be using $rank(AB) \leq \min(rank(A),rank(B)).$
As all $a_i,$ or $b_i$ can not be zero so you can't get rank 0 here.