There are two criteria by which eligibility is determined.
Country of birth
You must be born in a country that is included in the lottery list for that year. This list changes annually.
If your country of birth is not listed, but your spouse’s country is, you can apply on his/her behalf.
It does not matter in which country you live now and even what citizenship you have.
List of countries that do not participate in the Green Card Lottery DV-2024
Bangladesh, Brazil, Canada, China (Mainland), Colombia, Dominican Republic, El Salvador, Haiti, India, Jamaica, Mexico, Nigeria, Pakistan, Philippines, Peru, South Korea, United Kingdom of Great Britain (excluding Northern Ireland) including its dependent territories and Vietnam.
You must have completed secondary education (graduated from 11th grade of a school or a secondary specialized educational institution) or 2 years of confirmed work experience from the last 5 years in a highly qualified specialty.