When you get to distances that large, we determine the distance indirectly by measureing the redshift of the incoming light. Since the universe is expanding, everything is moving away from us (at great distances... at nearer distances, gravity is strong enough to overcome this expansion). The further away it is, the faster it moves away.
By measuring the amount of redshift, we can calculate the speed the galaxy is receding. (This works much like the Doppler shift in sound, such as when a speeding car or train passes.) The faster it is receding, the greater the distance. This is known in astronomy as Hubble's Law.
The answer to your second question is yes, if something is 400 million light years away, we are seeing it as it existed 400 million years ago.