Also note that Keywords is a phrase consisting of one or more words separated by a space. space between words in the phrases is always read as "AND"
The keyword operators are more complicated, and a space is not always interpreted as a logical AND:
"Keywords contain word1 word2" matches photos whose keywords contain the string "word1" or the string "word2", anywhere within the keywords. For example, "Keywords contain man boy" would match a photo containing the single keyword "policeman".
"Keywords contain all word1 word2" matches photos whose keywords contain the string "word1" and the string "word1" anywhere within the keywords. For example, "Keywords contain all man boy" would match a photo containing the two keywords "policeman" and "boyfriend", but it wouldn't match a photo containing the single keyword "policeman".
"Keywords contains words word1 word2" matches photos whose keywords contain the strings "word1" and the string "word2" as punctuation-separated "words" in the photos. For example, "Keywords contains words man boy" would match a photo with keywords "burning man" and "boy toy", but not a photo with just the keyword "man", and not a photo with the keywords "man" and "boyfriend".
"Keywords don't contain word1 word2" is logically equivalent to NOT (Keywords contain word1 word2), which is equivalent to (NOT Keywords contain word1) AND (NOT Keywords contain word2). That is, it matches photos whose keywords contain neither "word1" nor "word2" as strings. For example, "Keywords don't contain man boy" would exclude a photo with the single keyword "policeman".
To make things more complicated, it's impossible using the Keywords criterion to search precisely for a keyword containing multiple words. For example, "Keywords contains words John Ellis" would match a photo with keywords "St. John" and "Barbara Ellis". This is because the Keywords criterion treats the keywords as a single field containing all the photo's keywords.
You can often improve the precision of your search using ! to exclude unwanted words, e.g. using "! St" and "! Barbara". But good luck if you want to search for the two names "John Ellis" and "Barbara Jones" (and exclude "Barbara Ellis").
In general, LR's search wasn't designed to handle keywords containing multiple words.
The only way to do exact keyword search with LR's built-in features is by using the Keyword column of the Library Filter bar's Metadata browser.
This matches photos with ("John Rolfe Ellis" OR "Peter Charles Ellis") AND ("Barbara Gleason" OR "Edna Green").
But the Keyword column is very fussy to use, especially if you have hundreds or thousands of keywords, with its tiny scroll bar and no ability to search within a column for the desired keyword.
If you want precise, quick search of multi-word keywords, you'll need a plugin, e.g. the Filter By Keyword command of the
Any Tag plugin or the
Any Filter plugin.