When the object is moving away from the scientist.
When a scientist observes redshift in the spectrum of a distant space object, it means that the wavelengths of the light emitted by the object have been stretched, or shifted towards longer wavelengths. This phenomenon occurs when the object is moving away from the scientist. As the object moves away, the light waves get stretched, leading to a shift towards the red end of the spectrum. By analyzing this redshift, scientists can determine the object's velocity and its distance from Earth.