A couple of rules govern the use of I and Y:
1) English words do not end with I (nor do Eng. words end with U,V, or J)
Therefore, I is used in the middle of English words, Y is used at the end of Eng. words.
2) The single vowel Y (not multi-letter phonograms: -oy, -ey, -ay) changes to I when adding ANY ending (try/tried; beauty/beautiful; baby/babies, copy/copier), UNLESS the ending begins with I (trying [rather than triing!]; babyish, copyist).*
*In English we do not have an I followed by an I: "Hawaii" and "skiing" are foreign words which have not been conformed to English rules.
RESOURCES REFERENCED: The above info is shared with thanks to Wanda Sanseri (BFI.com) in SPELL TO WRITE AND READ; to Romalda Spalding in THE WRITING ROAD TO READING; and to Margaret M. Bishop in THE ABC'S AND ALL THEIR TRICKS. Check out these resources for add'l info!