I'm a high school student and I recently thought of an intuitive, but incorrect way of thinking about time dilation. My trouble lies in understanding why this intuition does not work. It should be noted that I have not yet been formally taught special relativity. Here is my thought process:
Suppose we have two hypothetical observers, one on a spacecraft moving at 0.5c and another that is stationary outside of the vehicle. Now suppose the spacecraft turns on its headlights. Since the speed of light is measured to be the same for all reference frames, both observers measure one second to have passed when the light beam has moved about 300,000km relative to themselves. For the one outside, that occurs after one second in their frame of reference. However, the outside observer also sees the light beam to be only 150,000km ahead of the spacecraft after one second, which is still moving at 0.5c relative to them. Therefore, it takes two seconds for the light beam to 'pull ahead' of the vehicle by 300,000km. For the observer inside, this is when they measure one second to have passed, and therefore, they must measure time to be ticking half as fast as the observer outside does.
However, when I plug 0.5c into the time dilation formula, I find that the observer in the spacecraft does not measure one second to pass for every two seconds that pass for the observer outside. Instead, the one inside measures $\sqrt{3}$ seconds to pass for every two seconds the observer outside measures. Where did I go wrong with this intuition? Why does thinking about time dilation this way not work? What is the correct intuition I should use to better understand time dilation? I appreciate any help.