When Rosh Chodesh is two days – one begins to count the days of the month from the second day, except for Tishrei where the counting is from the first, because Elul is not intercalated. And that which we observe two days of Rosh Hashanah – this is because of Rosh Hashanah, as will be explained in its place. But for other months, when Rosh Chodesh is two days, the first day belongs to the past month, because of the reasons that were explained in siman 417. Therefore, the Tur and the Shulchan Aruch ruled here regarding legal documents, and in Even HaEzer siman 126 regarding gittin, that when writing a legal document or a get on the first day of Rosh Chodesh – one writes "on the first day of Rosh Chodesh of such-and-such [month], which is the thirtieth day of such-and-such past month." And regarding legal documents, there is no concern even to write ab initio "on the first day of Rosh Chodesh of such-and-such [month]," and no more. However, regarding a get there is more concern. And even there, ex post facto – it is valid. See what I wrote in Even HaEzer there.
כשראש חודש שני ימים – מתחילין למנות ימי החודש מיום שני, לבד תשרי שהמנין מהראשון, מפני שאין אלול מעובר. ומה שעושין שני ימים ראש השנה – זהו משום ראש השנה, כמו שיתבאר במקומו. אבל שארי החודשים, כששני ימים ראש חודש, היום הראשון להחודש העבר, מפני הטעמים שנתבארו בסימן תיז. ולכן פסקו הטור והשולחן ערוך כאן לענין שטרות, ובאבן העזר סימן קכו לענין גיטין, דכשכותבין שטר או גט ביום ראשון דראש חודש – כותבין "ביום הראשון של ראש חודש פלוני, שהוא יום שלושים לחודש פלוני שעבר". ובשטרות אין קפידא גם לכתוב לכתחילה "ביום ראשון דראש חודש פלוני", ולא יותר. אך בגט יש יותר קפידא. וגם בשם בדיעבד – כשר. ועיין מה שכתבתי באבן העזר שם.