This may depend on what you used before on your clothes the type of bleach or detergent that made your white shirt turn yellow,
even though you can use other precautions to help or save your clothes from turning yellow or from bleaches and detergents from messing your clothes,
for example always try to hand wash your white clothes by avoiding the use of bleaches to wash your white color shirts.
For this Bleaching effects do contain chlorine and other strong chemicals that may be tough on fabrics,
also don`t put your clothes on direct sun light when drying it will fade your white shirts as well as the colored ones and turn them yellow.