Let me first stipulate what I gather from your post:
(a) you were abroad ??/??/2016 through 08/??/2018.
(b) you had earnings abroad
(c) Oct. 2018, you started a job in the USA
(d) From Aug/2018 through Sept/2018 you did not have health coverage, which started Oct/2018.
Q-1. Are you a citizen/ Resident of the USA and were you the same during 2016 through 2018 ( i.e. the period you were abroad )?
Q.2. What about your spouse and children?
Q.3. While abroad, did you exclude your foreign earnings? If not why not ? What country were you stating in ?
Absent any other issues ( based on your answers to the above Qs ), I do not understand why you would not have been ineligible to exclude your foreign earnings for the year 2018; nor why a short coverage gap of health insurance is to be penalized.