Below command you can use Tested and worked fine
awk '{for(i=1;i<=NF;i++) {if (($i == "word1") || ($i == "word2")) {print $0}}}' filename
Below command you can use Tested and worked fine
awk '{for(i=1;i<=NF;i++) {if (($i == "word1") || ($i == "word2")) {print $0}}}' filename