There was a big article about this in Popular Mechanics back in December. Read it here:
http://www.popularmechanics.com/science/air_space/4201569.html
Basically though it has to pass through a “gravitational keyhole”, an area about 1/2 a mile wide in space 18,893 miles from Earth. If it hits that spot when it passes us Friday the 13th of April 2029 it will get nudged just enough to put it into an orbit that will cause it to hit earth April 13, 2036.