Motor not moving together (Human following Robot)

The Arduino Motor Shield R3 uses A0 and A1 for measuring the current through the two motors. You should pick other pins for your ultrasonic sensor.

My guess is that the adafruit "AFMotor.h" library may not be directly compatible with the Arduino Motor Shield R3.