Put the eggs in a saucepan and add enough cold water to cover them by about 1 inch. Set the pan over medium-high heat and as soon as the water reaches a brisk simmer, start timing. As the eggs cook, adjust the heat as needed to maintain a brisk simmer. (Though we talk about hard-boiled eggs—and we’re using that term here—the fact is that cooking eggs in boiling water cracks the shell and makes the eggs tough and rubbery. A simmer works much better.)
From Fine Cooking's Test Kitchen:
Watch our How to Boil an Egg video to see an expert turn out soft-, medium-, and hard-cooked eggs without overcooking them.
Soft boiled: 2 minutes
The white is solid, but the yolk is still runny. Serve in an egg cup for breakfast. Use the side of a small spoon to crack and remove the pointed end of the egg, making a hole in the shell large enough to fit the spoon. Or use egg scissors, if you have them.
Medium boiled: 4-1/2 minutes
The yolk is solid but still dark orange-yellow, moist, and dense in the middle. Beautiful and delicious quartered on a salad.