Insider here..Summary:
1- If you belong to a list of 23 countries (most notably China, Iran and Russian) you will not be eligible unless you have a green card
2-If you do not belong to this list of countries, but reside overseas you will be excluded from hiring as well. Of course green card holders are safe..
3-If you are a phd candidate from a U.S. university, the situation is tricky. The Fed does not want to go for the H1B anymore. The government is taking a year or more to approve them, and being a big pain to us. Regionals feds are having another problem. They are not legally "government" but "private organizations", so the U.S hovernment is claiming they will no longer be exempted from the lottery.
The solution? The Fed may apply for your green card right after the offer is made and have you start as late as possible with the OPT, with the hope that once it expires the green card will be ready. Still very risky.. but feasible.