When you aren’t measuring the position of a photon, it is a wave. Thus, photons can interfere with themselves as they pass through the double slit. But measuring the location of a photon forces it to behave as a particle: when the photon hits the screen behind the double slit, it must strike in only one spot.