If the moon is visible in the western sky after sunset, then it is near the sun in the sky (because the sun also sets in the west). In this configuration, the sunlight falls mainly on the back side of the moon as seen from the Earth, and we only see a crescent of light on the thin region visible from both the sun and the earth. If the moon is rising as the sun is setting, then the two objects are nearly opposite one another in the sky. So we view the moon from the same vantage as the sun would (it would be as if one person (the sun) were looking over another's shoulder (the earth) at a third person (the moon). Anywhere the sun shines on the moon, we see. So the moon looks full.