How do I file a form 2555-EZ if my residence in a foreign country wasn't continuous?

I had residence in a foreign country for 284 days in 2017. My residence started in 2016 then ended in the middle of 2017. I went back to the US for about three months before coming back to the same foreign country and took up residence again.

Am I able/supposed to fill out the 2555-EZ (I did make less than $102,000 in total?) If so, how do I fill out the portion that asks for the dates of my residence since it wasn't continuous?