Regarding the halachos of standing up for rabbeim, should you stand for any rabbi that passes by you or maybe only your rabbeim / Rebbi Muvhak?
The question is dealt with in Halichipedia
Standing for a Talmid Chacham
There is a positive mitzvah to stand for a Talmid Chacham who is more knowledgeable in Torah than most people and not simply a Yeshiva Bachur.  One should stand for a Talmid Chacham once he enters one's 4 amot until he leaves one's view.
One should stand for one's Rebbe Muvhak once he enters one's eyesight until he leaves one's eyesight. A Rebbe Muvhak is defined as a teacher that one learned a majority of one's learning from.
A Gadol HaDor is considered like one's Rebbe Muvhak even if one didn't learn from him.
Details of Standing Up
For an elder or Talmid Chacham, one should stand up completely, not just partially. One should stand from the time the elder or Talmid Chacham enters one's 4 amot until he passes from before one's face; some say that one should stand until the elder or Talmid Chacham leaves one's 4 amot. 
According to Ashkenazic minhag, one has to stand for a particular Talmid Chacham or elder only once in the daytime and once at night unless one is in the presence of people who don’t know he stood previously; Sephardim, however, hold that one must stand up every time.  One should stand up even if one is middle of learning.  If one is middle of davening, one should stand up except for if one is middle of the first pasuk of Shema and according to some any part of Shema. Two talmidei chachamim do not have to stand for one another. 
There are some who try to justify a minhag of being lenient regarding standing for an elder and Talmid Chacham. 
I have provided some edited references from the article.
5 S”A 244:1 rules that it is a positive mitzvah to stand for a Talmid Chacham. Shach 244:2 explains that only a Talmid Chacham who is wiser than most people is considered a Talmid Chacham for this halacha. Yalkut Yosef YD 244:16 writes that one has to stand only for a Talmid Chacham who knows how to give psak in Even Haezer and Choshen Mishpat and not just someone learning in kollel.
6 Shulchan Aruch YD 244:2
7 Shulchan Aruch YD 242:16. Ran (Kiddushin 14a s.v. kemelo aynav) says that the reason that one needs to say for one’s rav muvhak when he sees him is because it is evident that one is standing in honor of one’s rebbe even though he is far away. The Rambam (Mamrim 6:3 as understood by the Griz Talmud Torah 5:11) says that one standing as far as one can see one’s rav muvhak because there’s an additional obligation of honoring him just like one honor’s parent, which is different than the regular obligation to stand for a talmid chacham.
8 Shulchan Aruch YD 242:30
9 S”A YD 244:10
16 Shach 244:11 seems to say that the minhag is to stand only for an Av Bet Din or Rosh Yeshiva, but he leaves it as a tzarich iyun. Rav Chaim Zonenfeld in Salmat Chaim YD 59-60 explains that the Shach doesn't mean that they uprooted a Deoritta but rather that the Talmidei Chachamim forgo the respect due to them. Rabbi Zonenfeld seems to say that this is not accepted as the Halacha but only a defense of the minhag. Moadim Uzmanim 3:248 writes that he's unsure if this is enough to rely on. Similarly, Sh”t Yabia Omer YD 3:13 writes that one should certainly not rely on the assumption that Talmidei Chachamim are mochel. Kavod VeHiddur p. 38 cites some who say that we assume that in general a Talmid Chacham is mochel. Rabbi Hershel Schachter (Halachipedia Article 5772 #15) stated that we assume a Talmid Chacham is mochel people standing for him.
The Rogachover in Salmat Yosef 1:3 writes that the biblical mitzvah of standing for a Talmid Chacham only applies to someone who has semicha going back to Moshe Rabbenu. Yabia Omer YD 4:16:2 rejects this based on a number of rishonim.
Regarding elders, Kavod VeHiddur p. 64 quotes Rav Elyashiv saying that the minhag has what to rely on, since we assume that elders forgo the respect due to them.
It is a Mitzvah to stand up in front of any scholar even if he isn’t one’s teacher
:מצות עשה לקום מפני כל חכם אפי' אינו זקן אלא יניק וחכים ואפי' אינו רבו