Praise be to Allah.
There are no isnaads in the books of the Sunnah and reports that we have read for the incident of ‘Umar ibn al-Khattab (may Allah be pleased with him) praying in the church at the time of the conquest of Bayt al-Maqdis. Similarly, there is no report from the Sahaabah to suggest that they prayed in the church.
The oldest report we have seen that mentions the details of the incident is the report of Ibn Khaldoon (may Allah have mercy on him), which says that the reason why ‘Umar ibn al-Khattab (may Allah be pleased with him) refused to pray in the church was the fear that the Muslims after him might take it as a mosque.
Ibn Khaldoon (may Allah have mercy on him) said: ‘Umar ibn al-Khattaab entered Bayt al-Maqdis, and came to the Church of the Resurrection and sat in its courtyard. When the time for prayer came, he said to the patriarch: I want to pray. He said to him: Pray where you are. But he refused, and he prayed on the doorstep of the church, on his own. Then when he had finished praying, he said to the patriarch: If I had prayed inside the church, the Muslims after me would have taken it (as a mosque) and they would have said: ‘Umar prayed here. And he wrote for them that they were not to gather to pray on the steps and that adhaan was to be given from that location.
End quote from Tareekh Ibn Khaldoon (2/225)
There is no isnaad for this incident, so it is not permissible to attribute it to ‘Umar (may Allah be pleased with him).
What appears to us to be the case is that its text is munkar (odd) and it is not valid for two reasons:
1. The Muslims are not entitled to take a church if a Muslim ruler or an ordinary Muslim prays in it, and that view [which says that if a Muslim ruler prays in it, it becomes theirs] is not known to the leading fuqaha’.
2. What is proven from ‘Umar (may Allah be pleased with him) is that he regarded it as permissible to pray in a church, if it is free of statues and images, but if there were such things in a church, ‘Umar ibn al-Khattaab would refuse to enter it, let alone pray in it.
Al-Bukhaari narrated in his Saheeh (1/167) from ‘Umar (may Allah be pleased with him) that he said: We do not enter your churches because of the statues and images in them. End quote.
For more information on the ruling on praying in churches, please see the answer to question no. 147007.
And Allah knows best.