See here
If your spouse turns 65 first
When your non-working spouse turns 65, they will be eligible for premium-free Part A and Medicare Part B if you are at least 62 years and have paid at least ten years of Medicare taxes.
If you are not yet 62, your spouse may still enroll in Medicare Part A (and Part B, which is optional). They will have to pay a premium for their Part A coverage. Once you turn 62 (and if you paid at least 10 years of Medicare taxes), your spouse will then be able to receive premium-free Part A.
*You must be married for at least one year before an older spouse can be eligible for Medicare based on your work record.