I know something about this... the US situation.
Yes, formerly you needed to return 'home' to renew a visa.
That was changed... renewals can now be made in the US.
Marriage-
once the green card application is accepted you are pretty well on your way,
EXCEPT you may not leave the US for 120 days (as I remember) maybe 90 days.... can't leave.
I can't figure that one out.
My daughter is in application and must honeymoon in the US... restricted travel outside.
If she leaves, she must wait the designated time before re-entry.
That's what she explained to me.
I have personal experience with this.
Marriage to an American citizen just makes the residency process a little easier than just an application with no family or marital ties.
The US considers "residency", i.e., "green card" as a desire to LIVE in the US. Once granted they expect you to LIVE in the US. Not six months in the US and six months outside. LIVE. I'm not sure there is an exact definition of that term so there may be some subjectivity to it.
My wife had her residency application in before we met as an unmarried child of a US citizen over 21. Her classification had some quotas attached. Because she had the application in the hopper, we did not get married because that would trigger the end of her first application, since one cannot have two visa applications being processed at the same time.
When she got her residency we were living in the DR with no plans to go back to the states and tied the knot. So through a US immigration lawyer she obtained what is called a "White Travel Document", a special document issued by the US---it's white and not blue---that permits her to live outside the US, renewable annually for three years at a cost of around US$450 per. It is targeted to foreign residents who may have a work assignment outside the US for extensive periods.
Ultimately she gave up her residency (and White Travel Document) because she was not living in the US, had no intention to, and got a ten-year tourist visa instead. Occasional trips back to the US do not allow her to hold residency, but a tourist visa will allow legal border crossings. We were told that if she ever wanted residency again there is an expeditied process for those who voluntarily gave up their residency for good reason ("good" was explained by a case manager at the US Consulateas meaning abiding by the specific letter of the immigration laws in an honorable manner.) Checking the box on the application that you once had a US Residency triggers the expedited process.
I suspect US Immigration will be cracking down on residency visa holders who do not live in the US. The same issue foreign snowbirds have in the DR---overstaying a tourist card---could be coming to America for Dominicans overstaying their tourist visa.