The best way to store eggs for longevity is to keep them in the refrigerator. Always store them in their original carton. The carton provides protection against absorbing odors from other foods and prevents moisture loss. It also shields them from temperature fluctuations.
Place the carton on an inside shelf, rather than in the refrigerator door. The door is the warmest part of the fridge and experiences the most temperature changes each time it is opened. Consistent, cold temperatures are key to preserving freshness and preventing bacterial growth.
As someone who loves home cooking, I find it incredibly frustrating when ingredients go bad before I can use them. Proper egg storage has significantly reduced my food waste.