21. In 6 parallel lines, the number of ways to choose 2 lines each time is $C_{6}^{2}$, so the total number of different rectangles (including squares) is $C_{6}^{2} \cdot C_{6}^{2}$. Also, the number of squares with side length 1 is $5^{2}$, the number of squares with side length 2 is $4^{2}$, $\cdots$, so the total number of squares is $5^{2}+4^{2}+3^{2}+2^{2}+$ $1^{2}=55$. Therefore, the total number of non-square rectangles is $\left(C_{6}^{2}\right)^{2}-55=170$.
21. In a square with side length 5, draw lines parallel to the sides through the 5 equal division points on each side, then the total number of rectangles formed that are not squares is $\qquad$ .