In X2, it appears that Jean and Storm don't know who Nightcrawler is. In Apocalypse, they do. By my understanding, Apocalypse was set in an earlier chronological time reference. What's going on?
In Days of Future Past, Magneto and Xavier, with the help of Kitty Pryde, send Wolverine's consciousness back in time to the 70's to change history.
He succeeds, and creates a new timeline.
X2 is in the original timeline. Apocalypse is set in this new timeline.