In the link you sent:
"If you meet the green card test at any time during the calendar year, but do not meet the substantial presence test for that year, your residency starting date is the first day on which you are present in the United States as a lawful permanent resident."
https://www.irs.gov/individuals/international-taxpayers/residency-starting-and-ending-dates
If you meet both the green card test and the substantial presence test in the same year, your residency starting date is the earlier of:
The first day you are present in the United States during the year you pass the substantial presence test, or
The first day you are present in the U.S. as a lawful permanent resident (green card holder).
So in other words (the way I understand it) an IR1/CR1 immigrant who gains green card status , say in August 2023 when they first enter the US, they are considered nonresident for tax purposes until August 2023 and resident after August 2023. If they want to be treated as a resident for the entire year to be able to file a joint return or claim a standard deduction, they need to send in a written declaration under 6013(h) stating explicitly that they want to be treated as a resident for the entire year with the tax return. This probably doesn't apply to AOS green card holders who are resident in the US for the entire year.
It is detailed here: https://www.irs.gov/pub/int_practice_units/JTO9431_02_10.PDF