Hi
You are tax resident here in any given year if you have either
1. Spent 183 days here in that year OR
2. Spent a total of 280 days in that year and the previous year combined.
However, if you are relying on rule 2, a period of up to 30 days will be ignored ( I.e. You will not be regarded as resident here in a year if you are less than 30 days here)
Be careful, though, on "ordinarily resident" . Being OR can drag you into the tax net under certain circumstances. You will continue to be OR until you have spent a minimum of 3 consecutive years as a non-resident.
To take your example, if you left on 1/10/2017, you would have 273 days here in 2017, and would therefore be tax resident here for 2017.
If you were away for all of 2018, you would have 0 days here so you aren't resident under the 183 day rule. Under the 280 day look back rule you do not break the 280 rule (273 days) so you are not resident for 2018. You could spend up to 30 days here, and still not be resident. However if you spent 31 days here you have 273 + 31 = 304 days in total and would be resident. So be careful on holidays!!
If you came back, on say July 1st 2019, you would have 183 days here and become resident under the 183 day rule. If you came back on say August 1st you are not caught under the 183 day rule. For the 280 day look back, you have 153 days plus whatever you spent here in 2018. If that were, say, 31 days your total is 153+31 = 184 and thus you escape under the 280 day rule.
Simple really. In the above scenario you would be ordinarily tax resident for 2017, 2018 and 2019 (and 2020 even if you stayed out for 2019).
Watching date of departure, and particularly date of return is important.
There is one other thing to watch out for - a thing called split year relief. In the 2017 scenario you are tax resident here for 2017 and your earnings after you leave are liable to tax here. If you make a declaration to revenue that you are leaving with the intention of not being tax resident in 2018, then they will stop your 2017 clock the day you leave (and any earnings after you leave for 2017 are not liable for tax here).
A similar mechanism applies in the year you return, thus protecting your foreign earnings from Irish tax up to the date of your return.
All clear?