A Gemara (rabbinic discussion) in Talmud Traktat Yoma 28b teaches that Avraham kept the whole Torah.
How can that be when the Jews only received the Torah at Mount Sinai many generations later?
There is a rabbinic discussion taking place in Yoma 28b, and one opinion is that Avraham kept the Seven Noachide Laws, as well as circumcision (Brit Milah) and Eruv Tavshilin. He only kept those Mitzvot but not the entire Torah. However, the Midrash Rabbah 11:7 teaches that Avraham didn’t keep the whole Torah.
The chassidic commentary Noam Elimelech comes up with an interesting statement:
“Avraham achieved the spiritual perfection of someone who had performed all the commandments.”
The famous chassidic commentary Degel Machane Ephraim states:
“The ultimate commandment is the understanding that there is ONE G – d. Pagan entities must be rejected. Avraham fulfilled this purpose perfectly.”
Various rabbinic commentaries claim that this Talmudic source should not be understood in a literal sense but rather symbolically. Avraham had a deeper understanding and thus on an extremely high spiritual level. He was fully aware of moral standards and of what is right and wrong.
After the Jews received at Torah at Mount Sinai, they were obligated to keep the whole Torah.