AP Style holds that you should abbreviate United Nations as U.N. (no space). You should use periods for consistency with U.S. within texts.
In headlines, however, United Nations should appear UN, without periods.
In datelines, it should appear as below,
UNITED NATIONS (AP) —
Use “U.N. General Assembly”, “U.N. Secretariat”, and “U.N. Security Council” in first references not under a United Nations deadline.
“General Assembly, “the Secretariat” and “Security Council, are acceptable in all references under a United Nations dateline and on second reference under other datelines.
Lowercase “the assembly” and “the council” when they stand alone.