An 8-by-8 chessboard contains 1,296 rectangles if you count every rectangle of any size whose sides follow the grid lines, including the 204 that are squares. To pick a rectangle you choose two of the board’s 9 vertical lines and two of its 9 horizontal lines; each choice can be made in 36 ways, and 36 × 36 = 1,296.
The same count equals the sum of the first eight cubes (1³ + 2³ + … + 8³ = 1,296), so a general n-by-n board has (n(n+1)/2)² rectangles. Subtracting the 204 squares leaves 1,092 rectangles that are not squares.
Source: OEIS A000537, Sum of first n cubes (number of rectangles in an n × n checkerboard)
Image: Chessboard diagram by Nevit Dilmen, public domain, via Wikimedia Commons.