Here's the instruction from IRS Form 8880 Credit for Qualified Retirement Savings Contributions:
Line 4.
Enter the total amount of distributions you, and your spouse if filing
jointly, received
after 2013 and before the due date of your 2016
return (including extensions) from any of the following types of
plans.
So, to get a contribution credit, your 2016 contribution has to exceed the withdrawals taken in
2014, 2015, 2016 and up to October 15, 2017. Next year that will all advance by one year.
The 2015 distribution will no longer be a factor for the 2018 tax year.