Praise be to Allah, and may peace and blessings be upon the Messenger of Allah.
First: Belief in the existence of jinn is obligatory in Islam.
The Noble Quran and the Prophetic Sunnah affirm their existence and explain that they are accountable for worshipping Allah. Among them are believers and disbelievers.
Allah Almighty says:
﴿And I did not create the jinn and mankind except to worship Me.﴾ [Adh-Dhariyat: 56]
Allah also informed us that they see us while we cannot see them. He says:
﴿Indeed, he and his tribe see you from where you do not see them.﴾ [Al-A'raf: 27]
Second: The ruling on denying the existence of jinn
Denying the existence of jinn as a rejection of what Allah has revealed in the Noble Quran is considered disbelief, because it amounts to rejecting what has been established in the Quran and Sunnah and is among matters necessarily known to be part of the religion.
However, if someone is unaware of this matter or has a misconception or doubt concerning it, the truth must be explained to them and the evidence established against them before declaring a specific individual to be a disbeliever.
Third: The ruling on praying behind someone who denies the existence of jinn
If someone is known to deny the existence of jinn and persists in this denial after the truth has been explained to them and the evidence established against them, then prayer behind that person is invalid, because they have rejected something firmly established in the Noble Quran.
However, if the person is ignorant of the matter or has a misconception, the truth should be clarified to them, and one should not rush to judge them until their situation becomes clear.
Conclusion:
The existence of jinn is established in the Quran and Sunnah, and belief in them is obligatory. Denying their existence after acquiring knowledge and having the evidence established constitutes disbelief. Prayer behind someone who persists in such denial is not valid.
And Allah knows best.