It goes both ways, the employer has to give the employee 3 months notice as well.
But this is for when both of them can't find a mutual solution. You can always agree to terminate the contract earlier, if both parties agree.
At least that is how it works in Germany.