Finding electron configuration by following the Aufbau principle
The so-called rule is to fill the subshells in increasing order of $n+l$. For subshells with the same value of $n+l$, the subshell with lowest $n$ is filled first.

$$\begin{array}{cc} \hline
n+l &amp; \text{Orbitals} \\ \hline
1 &amp; \mathrm{1s} \\
2 &amp; \mathrm{2s} \\
3 &amp; \mathrm{2p,3s} \\
4 &amp; \mathrm{3p,4s} \\
5 &amp; \mathrm{3d,4p,5s} \\
\vdots &amp; \vdots \\ \hline
\end{array}$$

For all intents and purposes, this is exactly equivalent to your heuristic of "go from the nearest noble gas", since to get the configuration of the noble gas itself you have to go through this same ordering of subshells. You can easily verify that the table above reproduces the order of filling of the Periodic Table.

Chromium and copper are exceptions to the rule (obviously there are many more).