The short answer is "yes", but the specifics depend on what you mean.
Can the words come in any order? Is this for just 2 words? Or more
than two words? If they're sets of words, does it count to find the
*same* word within N lines?
For two words in a fixed order (HI followed by BYE in the subsequent
3 lines), you can do something like
/\<HI\>\%(.*\n\)\{,2}.*\<BYE\>
where the "2" is the N-lines-minus-1
For HI and BYE withing 3 lines but the order might be reversed (BYE
then HI), it's likely easiest to do the same thing with the "or"
conjunction:
/\<HI\>\%(.*\n\)\{,2}.*\<BYE\>\|\<BYE\>\%(.*\n\)\{,2}.*\<HI\>
For arbitrary sets of words or patterns, followed by up to 3 lines,
such as HEY, HI, and BYE
/\<\%(HI\|HEY\|BYE\)\>\%(.*\_.\)\{,2}.*\<\%(HEY\|HI\|BYE\)\>
though that could find instances where the first and second words are
the same such as "HI...HI". If you want to make sure they are
different, you might use this monster
/\<\(HI\|HEY\|BYE\)\>\%(.*\_.\)\{,2}.*\<\%(\1\>\)\@!\%(HEY\|HI\|BYE\)\>
which uses the "the thing we captured as the first word can't match
at the point where we find the second word" "\@!" token.
They're ugly, but vim will at least let you do them.
-tim