In calcium, the electron configuration is 2-8-8-2. Why does the 3rd level have more energy than the 2nd if they're both 8?

The third level is further from the nucleus. N = 1, N = 2, N = 3, etc.