The attacker killed two people and was shot dead by armed police after he drove into a synagogue and stabbed several people.