Quantum mechanics postulates that we cannot determine the exact position of the electron without a collapse of the system, so easier said the position of the electron is given by a probability and not a determined position. This results in a spread of all possible position an electron can take, with a non-zero probability being positioned inside the nucleus.
The time-averaged position of the electron gives you a position the electron will take up with the highest probability over time.