How does a country join NATO?

How does a country can join NATO