Massachusetts Mandatory Health Coverage

Hey guys.

I have a specific question about the Mandatory Health Coverage in MA. 

If you don't have health insurance for 3+ months you pay a penalty on your tax return. 

But my case is different and I don't know what to do:

 

2019

January through June - I was an au pair and I had international insurance, because of the exchange program.

June - Got married to a US Citizen

July through December - I was out of status waiting for my green card. Because I was out of status, I could not have health insurance. I could not apply for Masshealth also because this would give me complications due to the Public Charge law. 

December - Got my green card. 

 

How can I avoid the state penalty, since I only did not have insurance because of my Immigration Status? 

Any thoughts?