This Halacha is an excerpt from our Sefer
Buy me here or on Amazon.com
When in Maariv is one to count?
Various customs exist as to the positioning of Sefiras Haomer after the Maariv prayer. Some communities are accustomed to reciting it after Kaddish Tiskabel, before Aleinu. Other communities however recite it after Aleinu. Practically, the Chabad custom, based on Admur in the Siddur, is to recite it after Kaddish Tiskabel, prior to Aleinu.
Kiddush Levana: The custom is to precede Sefiras Haomer to Kiddush Levana.
What is one to do if he is by a Minyan that counts after Aleinu?
If one is Davening by a Minyan who counts the Sefirah after Aleinu, he is to delay his count and count together with the Minyan after Aleinu. If one is an Avel, or has a Yartzite, and has to say Kaddish, he is to say only one Kaddish after both Aleinu and the Sefira. If, however the congregation does not agree to this, then he may say the Kaddish after Aleinu, before Sefirah, and also after the Sefirah, if so is their custom.
 Shaar Hakolel 49/7 that so was the directive of Admur; Chok Yaakov 489/20 [immediately after Kaddish Tiskabel]; Elya Raba 489/26; Chok Yosef 489/28; P”M 489 A”A 15 that he would say it before Vayiten Lecha; M”B 489/2 “Before Aleinu”; Darkei Chaim Veshalom 625 [before Aleinu]; Minhagei Berlin p. 144 [before Aleinu]; Likkutei Halevi [Minhagei Wotzberg] p. 12 [immediately after Shemoneh Esrei]; Minhagei Piruda 64 [before Aleinu]; Nivei Shalom Dinei Haomer 3 [before Aleinu]; Minhagei Na Amon [Alexandria] in name of Seder Hayom that one is to count before Aleinu; Nehar Mitzrayim Hilchos Omer 25 [After Kaddish Tiskabel]; Kav Chaim 48; Rivivos Efraim 1/334
 The reason: a) The Sefira is counted before Aleinu, versus afterwards, in order to be able to include Sefiras Haomer in the Kaddish that is said directly after Aleinu, as the Sefira requires a Kaddish afterwards [due to all the verses we say as part of Sefira] and it is forbidden to increase in Kaddeishim. [Shaar Hakolel 49/7; See Chikrei Haminhagim p. 158] b) In order to precede the Sefira as much as possible, and fulfill the Mitzvah of Temimos. [M”B ibid] c) Alternatively, it is said in Davening in order so the people who leave right after Aleinu do not forget to recite it. [Nehar Mitzrayim ibid] d) As Aleinu is always the closing prayer of the prayers, and we always insert all other matters beforehand, such as reading Megillah, Kinos etc. [Grac”h Na”ah, in letter printed in Kovetz Ohalei Sheim 7/43]
 Kaf Hachaim 489/102; Minhag Hagr”a [brought in Shaareiy Rachamim 489/2; Maaseh Rav Hashaleim Pesukei Dezimra 69Minhag Yerushalyim [brought in nehar Mitzrayim ibid and letter of Grac”h Na”h, printed in Kovetz Ohalei Sheim 7/43]; Minhag of majority of communities [recorded in Minchas Haomer 489/33 in name of Kovetz Hameasef 18/2]
 Shaar Hakolel 49/7 that so was the directive of Admur
 See Devar Yehoshua 2/13; Lehoros Nasan 1/28; Rivivos Efraim 2/127; Piskeiy Teshuvos 489/26; These Poskim discuss whether Kiddush Levana or Sefira should precede due to the contrast of the Tadir of Sefira versus Tadir of Kiddush Levana, and the fact that Sefira is possibly Biblical, although the custom is as stated above..
 Pashut as one is meant to say it with a Minyan, and the entire reason we say it before Aleinu is only because of the Kaddish; See also Igros Kodesh in next footnote
 Igros Kodesh 5/313 [printed in Shulchan Menachem 3/2] in a reply to Rav Yitzchak Dubov. This is despite the concerns brought earlier in Shaar Hakolel ibid regarding the prohibition to increase in Kaddeishim.