In the treaty of meguilah 13a says that all who leave idolatry are yehudin, And also in the comment: Daf Shevui to Megillah
This midrash is connected to a verse from Daniel where a minister refers to Jews as those who do not worship the Babylonian king’s god or bow down to his idols. This is also an apt description of Mordecai who refuses to bow down to Ahashverosh. From here R. Yohanan learns that anyone who denies idolatry is called a Jew. There may be some broader implications of this statement. R. Yohanan may be saying, in a sense, that all those who deny idolatry in his day are actually Jews. While I wouldn’t go so far as to say that he does not require conversion, he may be saying that when it comes to being inside the Jewish people, one way to be “in” is simply to deny idolatry.
Question: Why isn’t Halakha like that? In that case a goyim says this bringing this treaty is he Jewish or not?
It seems that there is a little bit of confusion here regarding the understanding of the text, therefore let’s go thru it, so we can understand it correctly. The topic of the Talmud is discussing why is Mordechai who was from the lineage of Saul and from the tribe of Binyamin called Yehudi as if he is from the tribe of Yehuda? To this the Talmud is answering that he was given this nickname “Yehudi” because he fought against idol worship, as everyone else bowed down to Haman and he refused, even though he was putting his life in danger. He was therefore awarded the name Yehudi, which is similar to Yehuda, which has the Holy name of H-shem in it. Yehuda is spelled Y-H-V-D-H, which when the D is removed it is the divine name. Therefore, as a reward or his self-sacrifice he was awarded to be called “Yehudi”. The gemora brings a proof to this that in the time of Daniel there were other people who sacrificed themselves not to bow to idols, and they were also given this name and title. It is not referring to what we nowadays call Jews a Yedhudi, which might be because Jews in general sacrifice themselves for H-shem, but the name of a person who is not a gentile is a “Yisroel” as all Jews are called Bnei Yisroel, the Children of Yisroel (Jacob).
As a side point, all gentiles are commanded to deny idol worship as one of the seven Noahide commandments (See Maimonides Kings Chapter 9-1,2), nevertheless the are still Noahides and not Jews. To be a Yisroel one needs to either be born into Israel, or to undergo a proper conversion, which included accepting to do all of the mitzvos etc., and to immerse in a kosher mikvah, and for a male to undergo circumcision. Without all three of these the person is still a gentile, even though he denies idols and believes in H-shem.