how does the redshift show galaxies are moving away from us
If a source of the light is moving away from an observer, then redshift occurs; if the source moves towards the observer, then blueshift occurs.
Redshift
If a source of the light is moving away from an observer, then redshift () occurs; if the source moves towards the observer, then blueshift () occurs. 
wiki:25663012
Redshift [SEP] Doppler effect
If a source of the light is moving away from an observer, then redshift () occurs; if the source moves towards the observer, then blueshift () occurs. This is true for all electromagnetic waves and is explained by the Doppler effect. Consequently, this type of redshift is called the "Doppler redshift". If the source moves away from the observer with velocity , which is much less than the speed of light (), the redshift is given by where is the speed of light. In the classical Doppler effect, the frequency of the source is not modified, but the recessional motion causes the illusion of a lower frequency.