It is always true that rank(AB)≤rank(B) (because the rows of AB are linear combinations of the rows of B). Also, rank(AB)≤rank(A) (because the columns of AB are linear combinations of the columns of A).

So for example if A is an m×n matrix with m<n, then rank(A)≤m, and rank(AB)≤m. Therefore AB can never be equal to the n×n identity matrix, which has rank n.