What's causes a 2001 ford exsporer to die when you turn on head lights?

I have a 2001 ford exsporer sport track with a 4.0 and it will ideal as long as the mass air flow sensor is un plugger but dies if its plugged in or when I turn on the head lights it will die to

A problem with the alternator, it's losing field coil current to the rotor. Usually a internal voltage regulator issue.

Alternate reasons:

1. It's 13 years old.
2. It's a Ford.
3. It was engineered and built in Detroit.