This is a good question and it is nice to help you son. As far as we know, there was no set law code in very ancient times in Egypt. From the hieroglyphs that we can translate, law was rooted in the power of the king, otherwise known as the pharaoh. This point should not be surprising, because the power of a king or emperor in the ancient world was absolute. In fact, the king was seen to be divine in the Ancient Near East. Hence, his decrees always had the force of law.
Second, as you can imagine, in time there would be many decrees of the king. After a while, these decrees became precedence for the future. In this sense, ancient Egyptian laws were very much like the law in America.
Third, according to some scholars, Egyptian laws were based on common sense notions of justice. Again, this should not surprise us, because this concept even existed in Roman law, which was much more sophisticated. There is evidence of local elders called, Kenbet, who presided over these meetings. If there was a particularly serious trial or legal question, it would come to the pharaoh.
I will attach a pretty extensive bibliography, if you want to do further research.