There are multiple ways to qualify for Medicare. Some of the ways to qualify include:
Turning age 65
Collecting Social Security Disability for 24+ months
Diagnosis of ESRD or ALS
You must also be a US citizen or legal resident for at least 5 years.