I'm going to divide this into two sections:
1: How did Lore know about the Entity?
I suspect the Entity had previously visited Omicron Theta. Remember in 'Datalore', we see children's pictures of the Crystalline Entity and all the havoc it had wreaked on the planet. How could the children have made this drawings unless there were two visits by the Crystalline Entity? In the final one, pretty much everyone was killed.
I think we can therefore safely assume the Crystalline Entity had been to Omicron Theta at least twice.
So, as to how Lore learnt about it, he probably was activated when the Crystalline Entity visited the first time.
2: How did Lore know how to communicate with the Entity?
The important thing to remember is that this was a science colony. If we accept my above proposition that the Entity had visited Omicron Theta more than once, chances are that there would have been some sensory data collected on it. Because Lore is pretty smart, he may well have figured out for himself how to communicate with it. In 'Silicon Avatar', we learn that graviton pulses can be used to communicate with the Entity; Lore probably figured this out. Admittedly, there is a discrepancy between 'Datalore' and 'Silicon Avatar', as in the former, Lore appears to speak using natural language to the Entity, but we could assume that Lore had programmed the Universal Translator to translate his language into meaningful graviton pulses.