Was Odysseus the one who planned the Trojan horse, in the Trojan War?

Yes, it was Odysseus who conceived a plan for the Achaians (Greeks) to get inside the walled city of Troy. Troy was ruled by King Priam, whose son Paris kidnapped Helen — Queen of Sparta and the most beautiful woman in the world — and took her to Troy. Thus began the Trojan War. Yet years after the war began, Troy, with its greatly fortified wall, remained intact while the Achaian army had been decimated.

Odysseus suggested constructing a great wooden horse with a hollow belly that would hold many warriors. In the darkness of night, the horse was taken to the gates of Troy. The next morning, the Trojans found the Greeks gone and the huge, mysterious horse on their doorstep. They also discovered a Greek named Sinon, who told them that Athena had deserted the Greeks and without her help, they were lost and so they departed. The horse was left to placate the angry goddess, and the Greeks hoped the Trojans would desecrate it, earning Athena's hatred. These lies convinced the Trojans to pull the gigantic horse inside the gates to honor Athena.

That night, after most of Troy had been drinking and celebrating the war that they thought they had won, Odysseus and his soldiers crept out of the horse and opened the gates of Troy to let the Achaian army in. They set fires throughout the city, massacred the Trojans, and looted the city. King Priam was killed, and all but a few Trojans died. Helen was captured with the remaining Trojan women; her fate from there varies by source.