You can contribute to an IRA if you meet the following rules even if you took out distributions:
The annual contribution limit for 2017 and 2018 is $5,500, or $6,500 if you’re
age 50 or older. You cannot contribute to an IRA if you are 70 1/2 or older.
Limitations occur
when you may want to deduct the contributions and you have a retirement plan
through your job.
https://www.irs.gov/retirement-plans/2017-ira-deduction-limits-effect-of-modified-agi-on-deduction-i...