Electrons orbit the nucleus. This is a well know fact, and without it, atoms wouldn’t exist. Still this isn’t possible according to classical physics, instead, the electron would lose energy and begin to spiral toward the nucleus. This has to do with the Maxwell’s equations (they describe what happens to electromagnetic fields). They say that an electric charge (the electron for example) that is in a non-uniform motion (a.k.a its speed or the direction of its speed changes) should radiate. Therefore an electron, which is going in a circular orbit around the nucleus and therefore has a changing direction of motion, would radiate away its energy, starting to move in a spiraling path until it reaches the nucleus.
The problem was that the electron would continuously loose energy and spiral toward the nucleus. But if you quantisize energy, the electron can’t loose it continuously. It has to loose it in specific quanta’s or not loose it at all. This would keep the electron from slowly spiralling inward, and it explains how it can only jump from one orbit to another. But how does it decide which orbits are allowed, that is were there positions are around the nucleus? At first there wasn’t any mechanism for this, but it was found that it could be explained by so called standing waves. A standing wave is when two waves traveling in the opposite direction meet and then create the impression of a wave that is standing still but oscillating:
The grey wave moves to the right and the black wave to the left. So they together would look Like one oscillating wave.
If you the treat the electron as a wave which produce an standing wave around the nucleus, it can create different interference patterns. A interference pattern arrise when two waves overlap each other.
An interference pattern can either be destructive, that’s when the peaks and troughs of each wave are turned in opposite direction (as in the pic above). Or reinforcing, when they are turned in the same direction.
When you have the electrons round orbit around the nucleus, the standing wave it produce would also have to be wrapped in a circular shape around the nucleus. It was found that in order not to create a destructive but reinforcing interference pattern when the standing wave was wrapped around the nucleus, the number of oscillations had to be a whole number: 1, 2, 3 etc. If the number of oscillations where a fractal; 1.1, 2.2, 3.3 etc there would be a destructive interference. Thereby the orbits couldn’t be anywere around the nucleus, but only at certain positions were they form standing wave with a whole number oscillations. Since if the interference pattern is destructive that orbit is forbidden, since it would be unstable, and nature always strives for stability.