Unfortunately, if you’re not lawfully present in the U.S., Medicare won’t pay for your Part A and Part B claims, and you can’t enroll in a Medicare Advantage Plan or a Medicare drug plan.
However, you are just traveling abroad you should watch a video by CMS: