I am thinking of applying for a head of department job in maths. Will I be considered if I have not taught maths as my main subject for four years? Have I a chance with senior management jobs? I have the skills and ability, but I feel that it will seem to those recruiting as a jump from being second in department.
Without more information, it is not possible to give a clear answer. What have you been teaching for the past four years and why has it not been maths? Have you been keeping up to date with developments in maths?
It seems that you are looking for promotion to a leadership role. If you have not yet explored that, it would be better to consider what skills you need for such a post and set about acquiring them before applying for a new job.
As there may be little difference in salary terms between the headship of a large maths faculty and a deputy headship in a small secondary school, be clear in which direction you want your career to be heading.