Question: I always daven maariv early in the Summer as I can’t stay up until after nacht every night to count the omer. Can I count the omer early or should I wait until the next day to count?
Answer: The Gemara (Shabbos 34b) writes that there is a doubt as to whether the time period between shekia (sunset) and tzeis hakochavim (nightfall) known as bein hashemashos, belongs to the end of the day, or to the beginning of the following night. Generally, we follow the rule that when it comes to matters of doubt we rule stringently with matters that are mideoraisa and leniently with matters that are miderabanan.
As there is a machlokes as to whether counting the omer nowadays is mideoraisa or miderabanan, there is a machlokes as to whether one needs to wait until tzeis to count.
Thus, Rambam (Temidin Umusafin 7:22) who holds that counting the omer nowadays is a mitzva deoraisa writes that one should wait until tzeis to count (See Biur Halacha 489:1).
Tosafos (Menachos 66a, first opinion), the Rosh (Pesachim 10:40) and his son, the Tur (OC 489:1), however, write that one may count from shekia, as they hold that counting nowadays is derabanan.
Following this, the Mishna Berura (489:14) writes that as most poskim hold that counting nowadays is derabanan, one may count from shekia. Nonetheless, it is ideal to wait until after tzeis (See Aruch Hashulchan OC 489:7).
Other poskim, however, including the Bach (OC 489:1), Shulchan Aruch Harav (OC 489:12) and R’ Ovadia Yosef (Yechave Daas 1:23) write that it is acceptable to count after shekia.
In conclusion, if one finds it difficult to stay up until nightfall, one may count the omer with a beracha after shekia.