There are precisely four passages where the Torah talks of the requirement to tell one's children about the Exodus:
Shemot 24:26-27
וְהָיָ֕ה כִּֽי־יֹאמְר֥וּ אֲלֵיכֶ֖ם בְּנֵיכֶ֑ם מָ֛ה הָעֲבֹדָ֥ה הַזֹּ֖את לָכֶֽם׃ וַאֲמַרְתֶּ֡ם זֶֽבַח־פֶּ֨סַח ה֜וּא לַֽיהוָ֗ה אֲשֶׁ֣ר פָּ֠סַח עַל־בָּתֵּ֤י בְנֵֽי־יִשְׂרָאֵל֙ בְּמִצְרַ֔יִם בְּנָגְפּ֥וֹ אֶת־מִצְרַ֖יִם וְאֶת־בָּתֵּ֣ינוּ הִצִּ֑יל וַיִּקֹּ֥ד הָעָ֖ם וַיִּֽשְׁתַּחֲוּֽוּ׃
And when your children ask you, ‘What do you mean by this rite?’ you shall say, ‘It is the passover sacrifice to the LORD, because He passed over the houses of the Israelites in Egypt when He smote the Egyptians, but saved our houses.’” The people then bowed low in homage.
Shemot 13:8:
וְהִגַּדְתָּ֣ לְבִנְךָ֔ בַּיּ֥וֹם הַה֖וּא לֵאמֹ֑ר בַּעֲב֣וּר זֶ֗ה עָשָׂ֤ה יְהוָה֙ לִ֔י בְּצֵאתִ֖י מִמִּצְרָֽיִם׃
And you shall explain to your son on that day, ‘It is because of what the LORD did for me when I went free from Egypt.’
Shemot 13:14:
וְהָיָ֞ה כִּֽי־יִשְׁאָלְךָ֥ בִנְךָ֛ מָחָ֖ר לֵאמֹ֣ר מַה־זֹּ֑את וְאָמַרְתָּ֣ אֵלָ֔יו בְּחֹ֣זֶק יָ֗ד הוֹצִיאָ֧נוּ יְהוָ֛ה מִמִּצְרַ֖יִם מִבֵּ֥ית עֲבָדִֽים׃
And when, in time to come, your son asks you, saying, ‘What does this mean?’ you shall say to him, ‘It was with a mighty hand that the LORD brought us out from Egypt, the house of bondage.
Devarim 6:20-21:
כִּֽי־יִשְׁאָלְךָ֥ בִנְךָ֛ מָחָ֖ר לֵאמֹ֑ר מָ֣ה הָעֵדֹ֗ת וְהַֽחֻקִּים֙ וְהַמִּשְׁפָּטִ֔ים אֲשֶׁ֥ר צִוָּ֛ה יְהוָ֥ה אֱלֹהֵ֖ינוּ אֶתְכֶֽם׃ וְאָמַרְתָּ֣ לְבִנְךָ֔ עֲבָדִ֛ים הָיִ֥ינוּ לְפַרְעֹ֖ה בְּמִצְרָ֑יִם וַיּוֹצִיאֵ֧נוּ יְהוָ֛ה מִמִּצְרַ֖יִם בְּיָ֥ד חֲזָקָֽה׃
When, in time to come, your children ask you, “What mean the decrees, laws, and rules that the LORD our God has enjoined upon you?” you shall say to your children, “We were slaves to Pharaoh in Egypt and the LORD freed us from Egypt with a mighty hand.
The Haggadah, based on the language of these passages, understands the Torah in these four passages to be describing how one teaches four archetypal children about the Exodus: respectively, the wicked son (who uses the exclusionary language of 'what do you mean'), the son who cannot ask (where the passage does not mention a child asking a question), the simple son (who asks in a naive, unsophisticated way), and the wise son (whose question is detailed).
This approach is based on that of (pseudo-)Malbim in his commentary on the Haggadah. I would recommend taking a look inside where he provides many more inferences from each passage that relate to its midrashic son. It's available online in the original Hebrew here, and there is also an English translation available for purchase.