Count it by shape:
length x width
1 x 1: 12
1 x 2: 9
1 x 3: 6
1 x 4: 3
2 x 1: 8
2 x 2: 6
2 x 3: 4
2 x 4: 2
3 x 1: 4
3 x 2: 3
3 x 3: 2
3 x 4: 1
Add everything up, and you get 60.
If you consider the "squares" as rectangles, then we can count the number of rectangle sizes there are.
For the size 1x1 there are 12 squares/rectangles.
For the next size which is a 2 x 1, there are 17 rectangles.
For the next size which is a 3 x 1, there are 10 of those rectangles.
For the next size which is a 4 x 1, there are 3 of those rectangles.
For the next size which is a 2 x 2, there are 6 of those squares/rectangles.
For the next size which is 2 x 3, there are 7 of those rectangles.
For the next size which is 2 x 4, there are 2 of those rectangles.
For the next size which is 3 x 4, there is 1 rectangle.
For the last size which is 3 x 3, there are 2 of those squares/rectangles.
Altogether there are 40 rectangles and 20 squares. (You might count squares as rectangles.)