On that IRS page it says:
"For this purpose, foreign earned income is income you receive for services you perform in a foreign country during a period your tax home is in a foreign country and during which you meet either the bona fide residence test or the physical presence test."
It sounds like one must also be tax resident in the foreign country for this to work?