On the one hand $\text{rank}(XA)\leq \min\left(\text{rank}(X), \text{rank}(A)\right)\leq \text{rank}(A)$.
On the other hand $\text{rank}(A)=\text{rank}(AXA)\leq \min\left(\text{rank}(A), \text{rank}(XA)\right)\leq \text{rank}(XA)$.
On the one hand $\text{rank}(XA)\leq \min\left(\text{rank}(X), \text{rank}(A)\right)\leq \text{rank}(A)$.
On the other hand $\text{rank}(A)=\text{rank}(AXA)\leq \min\left(\text{rank}(A), \text{rank}(XA)\right)\leq \text{rank}(XA)$.