Nigel Farage announced he is resigning as an MP, triggering a by-election he will stand in.