(⇐) Suppose $B$ is the identity matrix. When the augmented matrix $\augmented{A}{\zerovector}$ is row-reduced, the result is $\augmented{B}{\zerovector}=\augmented{I_n}{\zerovector}$. The number of nonzero rows is equal to the number of variables in the linear system of equations $\linearsystem{A}{\zerovector}$, so $n=r$ and Theorem FVCS gives $n-r=0$ free variables. Thus, the homogeneous system $\homosystem{A}$ has just one solution, which must be the trivial solution. This is exactly the definition of a nonsingular matrix (Definition NM).
(⇒) If $A$ is nonsingular, then the homogeneous system $\linearsystem{A}{\zerovector}$ has a unique solution, and has no free variables in the description of the solution set. The homogeneous system is consistent (Theorem HSC) so Theorem FVCS applies and tells us there are $n-r$ free variables. Thus, $n-r=0$, and so $n=r$. So $B$ has $n$ pivot columns among its total of $n$ columns. This is enough to force $B$ to be the $n\times n$ identity matrix $I_n$ (see Exercise NM.T12).