There are several ways to search the Iliad to find a specific reference.
Many print editions of the Iliad have indices in the back. To find episodes with both Ajax and Hector, look in the index for “Ajax” and then for “Hector” and note places where both names occur in close proximity. If your own copy of the Iliad lacks an index, several editions with indices should be available at nearby school, public, or university libraries.
You can download public domain copies of the Iliad from many internet sites. Do a Boolean search to find the names Hector and Ajax, or just search for the occurrences of one of the two names and skim relevant passages until you find the second name.
Scholars in classics use the Thesaurus Linguae Graecae to search the actual Greek text when they are doing close analysis of ancient texts.