The rectangles require 3 consecutive squares in a straight line.

Each of the 8 rows contains 6 sets of 3 horizontally adjacent squares.

That's 6 rectangles per row over 8 rows.

The rectangles in the columns can be counted in the same way.

There are no diagonal rectangles.