An electron bound to the nucleus by the mutual attraction between unlike charges, has a negative energy. Its most tightly bound to the nucleus nearer it is to the nucleus. That is an electron has least energy when it is in the n=1 shell. As the electron moves away from the nucleus its energy becomes less and less negative, i.e. its energy increases. When the electron is not under the attractive Coulomb force of the nucleus its potential energy is zero and whatever energy it has now, is kinetic energy, which is always positive. So farther the electron more energy it has.