On the Shabbat immediately preceding Rosh Hodesh, the Hazan or Rabbi announces in the synagogue which day or days that week will be observed as Rosh Hodesh. It is proper for the Hazan or Rabbi to have in mind at that time the configuration of the Divine Name which corresponds to the new month. The Name of "Havaya" (spelled "Yod," "Heh, "Vav" and "Heh") has four letters, which can be arranged in 12 different ways. Each configuration of the four letters corresponds to one of the twelve months of the Jewish calendar, and each month’s configuration should be announced together with the announcement of Rosh Hodesh on the preceding Shabbat. (For example, the configuration corresponding to the month of Sivan is "Yod" and "Vav," followed by "Heh" and the other "Heh." The first of these two pairs – "Yod," "Vav" – are the letters which represent masculinity, whereas the two "Hehs" represent femininity. At the beginning of the month of Sivan, in preparation for Matan Torah, G-d instructed that the husbands and wives should refrain from marital relations for three days. Therefore, the configuration corresponding to this month is the one which separates the two "male" letters from the two "female" letters, symbolizing the period of separation that was observed in the days before the Torah was given.)
When Rosh Hodesh falls on Sunday, it is announced that Rosh Hodesh will occur "Be’yom Ehad" – as opposed to the more common term for Sunday, "Yom Rishon" – just as when we recite the "Shir Shel Yom" on Sunday, we refer to it as "Yom Ehad." Furthermore, when we announce the day, we add the words "Be’Shabbat Kodesh," just as we do in the "Shir Shel Yom" ("Yom Ehad Be’Shabbat Kodesh," "Yom Sheni Be’Shabbat Kodesh," etc.). The reason is that by identifying a day in reference to its position in the week vis-ŕ-vis Shabbat, we fulfill the Misva of remembering Shabbat ("Zachor Et Yom Ha’Shabbat Le’kadesho") as understood by the Ramban. According to the Ramban, this command requires us to be mindful of Shabbat even during the week, an obligation we fulfill by identifying each day of the week in reference to Shabbat. Therefore, when we announce Rosh Hodesh, too, we should mention Shabbat in order to seize the opportunity to fulfill this Misva.
If Rosh Hodesh falls on Shabbat, then we announce Rosh Hodesh the previous Shabbat, saying that Rosh Hodesh will occur "Be’yom Shabbat Kodesh."
When Rosh Hodesh is two days, then we announce that Rosh Hodesh will be on such-and-such day "U’le’mahorato" – "and on the following day," and we then identify the next day.
Summary: When we announce Rosh Hodesh on the preceding Shabbat, it is proper to for the Rabbi or Chazan to have in mind the configuration of the Divine Name of "Havaya" which corresponds to the new month, and we refer to the day in reference to Shabbat – "Ehad Be’Shabbat Kodesh," "Sheni Be’Shabbat Kodesh," "Shelishi Be’Shabbat Kodesh," etc. If Rosh Hodesh falls on Shabbat, then we announce the week before that Rosh Hodesh will occur "Be’yom Shabbat Kodesh."