First, Odysseus correctly tells the swineherd, "Odysseus is on his way" home. He lies about his homeland (Crete) and his mother who was not a slave, but his father was probably a rich man. The story about the Trojan War is true, but he didn't attack Egypt, meet the king, or live there 7 years. He doesn't sail with a "scoundrel" Phoenician, but he was the sole survivor of a ship that sank, and he washed ashore on a beach, just not Thesprotia where he supposedly heard of Odysseus.
His final story about fighting at Troy with Menelaus and Odysseus is based on truth although he probably didn't leave his cloak at camp. He uses this tale as a ploy to test Eumaeus' hospitality.
Eumaios (or Eumaeus) was Odysseus' faithful servant, one of the few who had not betrayed him. Odysseus arrive in Ithaca disguised as a beggar (at the urging and power of Athena) so that he could assess the situation at home. Eumaeus doesn't recognize him, but being the kind heart that he is, he invites Odysseus, the beggar, the share his home as if he were an equal. There are several instances of fact and fiction in what is said to Eumaeus. First the beggar tries to get Eumaeus to ask if one of the suitors will employ him since his master has been gone for so long, this was meant as a test. Then Odysseus, "the beggar" claims to have "news" of Odysseus and he spins a yarn about what he knows of "meeting" Odysseus in order to get Eumaeus to stall Penelope's meeting with the suitors. He tells him that he escaped slavery (fiction), was there at the Trojan war (fact, Odysseus was there), he tells him of some royal heritage (fiction, kind of), he says that Zeus destroyed one of his ships (fiction, Poseidon destroyed Odysseus' ships). The biggest truth that Odysseus reveals is in Book 21 when Odysseus tests Eumaeus and Philioteus' loyalty once more and at confirmation reveals his true identity and promises them he will treat them like sons for their help in defeating the suitors.