You must be 65 years or older and a U.S. citizen or legal resident living in the United States for at least five years to qualify for Medicare. You may qualify for Medicare if you receive Social Security or railroad retirement benefits and are not collecting them. You also may qualify if you are retired or you or your spouse is a government employee who did not pay into Social Security but had Medicare taxes withdrawn from their pay when they worked. You also qualify if you are disabled or have certain health conditions.