لو نزل المني إلى أصل الذكر ثم لم يخرج فلا غسل وكذا لو صار المني في وسط الذكر وهو في صلاة فأمسك بيده على ذكره فوق حائل فلم يخرج المني حتى سلم من صلاته صحت صلاته فإنه مازال مطهراً حتى خرج والمرأة كالرجل في هذا إلا أنها إذا كانت ثيباً فنزل المني إلى فرجها ووصل الموضع الذي يجب عليها غسله في الجنابة والإستنجاء وهو الذي يظهر حال قعودها لقضاء الحاجة وجب عليها الغسل بوصول المني إلى ذلك الموضع
المنهاج في شرح صحيح مسلم للنووي كتاب الحيض باب وجوب الغسل على المرأة بخروج المني منها
If semen [maniy] comes down to the opening of the penis, but then does not come out, there is no washing required. Likewise if the semen reaches the middle of the penis, and a man is in prayer but takes hold of his penis with his hand through his clothes, and the semen does not come out until he concludes his prayer, then his prayer is valid, since he remains pure until it comes out. And the woman is like the man in this regard, except in the case that she is a formerly married woman, and the semen [maniy] comes down to her vagina and reaches the place which requires washing from sexual impurity and cleaning in general (that is, the parts that are visible when she is sitting down to fulfill her need); then it is required for her to wash, since the semen reached this location.
Al-Nawawi, Al-minhaj fi Sharh Sahih Muslim [Open Path to Exposition of Sahih Muslim], The book of menstruation, Section: obligation for a woman to wash [ghusl] if semen comes out of her