What happened to Yamato?
Yamato was controlled by spiral zetsu (tobi) just before the infinite tsukuyomi. Since Yamato and zetsu both know wood release, their powers combined was enough to stop the Third Hokage with "Sage Art Wood Release: True Several Thousand Hands".

Chapter 677

Episode 426