There is no requirement for a Green Card or Citizenship. As long as you are legally in the United States, you can potentially qualify for the credit.
You seem to already know the rules for becoming a Tax Resident, but just in case ... a person on a F-1 visa is usually a Nonresident Alien for the first 5 calendar years that they are in the US. You generally would become a Resident Alien in the 6th calendar year that you are in the US. I just wanted to point that out because some people are not aware of that rule.