Former President Donald Trump will be banned from Facebook until at least 2023, including ahead of a critical midterm election.