All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The passing of wind is one of the nullifiers of ablution. So, if it happens to the person while praying, his prayer is invalid because it nullifies the Tahaarah (purity) which is a condition for the validity of the prayer. This ruling applies when the passing of the wind is normal, but if this passing is continuous and does not stop for a period of time enough for the person to perform his ablution and prayer, then its ruling is similar to the ruling of incontinence of urine.
So, the person who has this problem performs ablution after the beginning of the time of each prayer and prays the obligatory and any other supererogatory prayers and the passing of wind in this case does not have any effect on the Tahaarah unless the person voluntarily does it.
If the person has periods of time when this problem does not happen to him, he should wait for those periods and perform the prayer then, even if this causes him to miss praying in congregation or praying the Friday prayer because having a valid prayer is more required than praying in congregation. This is only if he does not fear that the fixed time of prayer will end before he could pray; otherwise, he performs ablution and prays.
For more benefit on the prayer of a person suffering from wind incontinence, please refer to Fataawa 335023, 380521, 380305 and 361699.
Allah knows best.