Not the same number of amp hours, but the same number of available watts (storage), which is what I suspect you are after.
2 x 24 x 100 = 4800
4 x 12 x 100 = 4800
You actually get more watts than that because you're dealing with somewhat higher voltages, but this gives you the concept.
The thing to keep in mind, though, is that lower voltages mean bigger wire sizes are required because each wire will be carrying a larger number of amps. Many people like 12V because it works well with vehicle systems, but if in a building, 24 or 48 volts is generally easier. I built my small "shed" system as 24 V, and wish I had gone with 48 V instead.