Ibn ʿUmar never offered the Duha prayer except on two occasions: (1) Whenever he reached Mecca; and he always used to reach Mecca in the forenoon. He would perform Tawaf round the Kaʿba and then offer two rakʿat at the rear of Maqam Ibrahim. (2) Whenever he visited Quba, for he used to visit it every Saturday. When he entered the Mosque, he disliked to leave it without offering a prayer. Ibn ʿUmar narrated that Messenger of Allah ﷺ used to visit the Mosque of Quba (sometime) walking and (sometime) riding. And he (i.e. Ibn ʿUmar) used to say, "I do only what my companions used to do and I don't forbid anybody to pray at any time during the day or night except that one should not intend to pray at sunrise or sunset."
أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ يَزُورُهُ رَاكِبًا وَمَاشِيًا قَالَ وَكَانَ يَقُولُ إِنَّمَا أَصْنَعُ كَمَا رَأَيْتُ أَصْحَابِي يَصْنَعُونَ وَلاَ أَمْنَعُ أَحَدًا أَنْ يُصَلِّيَ فِي أَىِّ سَاعَةٍ شَاءَ مِنْ لَيْلٍ أَوْ نَهَارٍ غَيْرَ أَنْ لاَ تَتَحَرَّوْا طُلُوعَ الشَّمْسِ وَلاَ غُرُوبَهَا