You can find out how the /testforblocks command works here. The syntax is exactly the same as the /clone command. Basically, the first two sets of coordinates specify the two corners of the first cuboid region you want to test, and the third set of coordinates specifies the lower northwestern corner of the cuboid region you want to test your first region to. Both regions will be the same size. In more recent versions of Java Edition Minecraft you can tell which corner of your structure is the lower northwestern corner by hitting F3 and looking at the axes in the center of your screen; whichever corner or your region fits into those axes is the lower northwestern corner of that region. This same trick applies to the /clone command.
In 1.13+, the /testforblocks command was moved into the /execute command to make it easier to compare regions and due something accordingly in the same command. Instead of using the command
/testforblocks 0 0 0 5 10 5 20 10 20
you can use
/execute if blocks 0 0 0 5 10 5 20 10 20
and modify the command to fit what you want. You can read more about the /execute command here.
I'm aware that this post is 3 years old, but this seems like an important question to answer as the syntax of the /clone and /testforblocks commands are very confusing.