When Lore was introduced in "Datalore", he gave two contradicting versions of his history when Picard wonders aloud who was created first, Lore answers, "He was, but they found him to be imperfect, and I was made to replace him." and then when he and Data are talking he says that he lied and he was created before Data, but it was because he was made perfect on the first try, and the colonists became envious of him and told Soong to create another "less-perfect android".
Lore's real backstory was given only later in the episodes "Brothers" and "Inheritance." After several failures Dr. Soong was finally able to create a stable positronic matrix in Lore. However Lore was unstable emotionally and caused so much strife between the colonists that Soong had no choice but to deactivate him. After so many failures and the pain caused by Lore Juliana was opposed to Soong building any more androids, but Soong decided to build just one more android. He planned on repairing Lore after he and his wife Juliana built and tested Data, but before he could do that the colony was destroyed by the Crystalline Entity and Soong and his wife were forced to flee. Unknown to Soong, his wife, or the colonists at the time, it was Lore himself who had contacted and attracted the Crystalline Entity to the colony to destroy it. Data meanwhile had been left outside with no memories or any idea of who he was.
In 2364 Lore's remains were discovered in Soong's lab in the episode "Datalore." Lore was rebuilt and reactivated. Although Lore initially appeared as inquisitive and harmless as Data, his true nature was gradually revealed during the episode. Lore secretly contacts the Crystalline Entity again, offering it the crew of the USS Enterprise as sustenance. However, Data foils his plans and transports Lore into space before the Crystalline Entity can attack, saving the ship.
In the episode "Brothers", Soong summons Data to Terlina III in order to give him an emotion chip. However, the same signal summons Lore, who had been found drifting in space and rescued by a group of Pakleds. Lore incapacitates Data and poses as him while Soong installs the chip. He then fatally wounds Soong before fleeing.
In "Descent, Part II", Lore revealed that he later encountered a group of Borg struggling with individuality following the Enterprise crew's actions in "I, Borg", and became their leader. Lore uses Soong's emotion chip to control Data until Geordi La Forge, Jean-Luc Picard and Deanna Troi manage to reactivate Data's ethical programming. Data shoots Lore at the end of the episode and then deactivates him permanently. As he is being deactivated Lore's final words to Data are "I love you... brother." and Data replies, "Goodbye, Lore."
Data then had the Enterprise engineering department dismantle Lore, retrieving his emotion chip in the process.