Step-by-step explanation:
for any matrix multiplication number of columns of first matrix should be equal to number of rows of second matrix.
For AB
A has 3 columns and B has 3 rows so it matches . Hence can be multiplied.
For BA
B has 2 columns and A has 2 rows it also matches so can be multiplied