Rashi on Bereshis 26:8 indicates that Avimelech saw Yitzhak sleeping with his wife. A) Why were they having relations during the daytime? B) Why were they having relations in a way that others could see?
A) Why were they having relations during the daytime?
Where do you see that it says anything about daytime?
B) Why were they having relations in a way that others could see?
The שפתי חכמים answers your question.
He says that it's impossible to say that they would have relations where people could see them.
Rather, by Yitzchak closing the window while being secluded with Rivka, it was obvious to Avimelech that they were going to do something very intimate.
He says that וישקף always means understanding and not physically seeing.
דלא תימא שראהו ממש משמש, דחלילה לצדיק כמוהו להניח חלון פתוח, אלא שסגר החלון ומכח זה הבין אבימלך, וזהו וישקף ר"ל השגחה והבנה, בעד החלון ר"ל כנגד החלון, כמו כל בעד שבמקרא.
The verse thus reads:
וַיַּשְׁקֵ֗ף אֲבִימֶ֙לֶךְ֙ מֶ֣לֶךְ פְּלִשְׁתִּ֔ים בְּעַ֖ד הַֽחַלּ֑וֹן
Avimelech contemplated was was going on behind the closed window
וַיַּ֗רְא וְהִנֵּ֤ה יִצְחָק֙ מְצַחֵ֔ק אֵ֖ת רִבְקָ֥ה אִשְׁתּֽוֹ
and he understood that Yitzchok was being intimate with Rivka [who must therefore be] his wife.
Alternatley you may prefer the answer of the אור החיים - but I have diffuculty understanding it - and thus will refrain from translating it.
מצחק את רבקה. פי' מעשה חיבה הנעשית בין איש לאשתו ולדברי האומר (ב''ר פס''ד) מצחק משמש מטתו אולי שהיה באחד מהדרכים שמותר אפי' ביום כמו שתאמר לרפואה וכמו שכתב רמב''ם (הלכות דעות פ' ד') או כמעשה שהובא בש''ם (כתובות סה) דביתהו דאביי דגלית וכו' ואזל רבא וכו' כי הצדיקים יחושו לדומה דדומה דכיעור לבל יכשלו בו:
The Tur al HaTorah says we must assume this happened during the day otherwise how could Avimelech have seen into a dark room. He explains this behavior with the idea that a Talmid Chacham can cover himself and have relations during the day. This is similar to the Or HaChaim who quotes the gemara in ksuvos 65a where we find this behavior as a means to stave off the yeitzer haraa, not simply giving in to desire.
Another point as far as how he actually saw them is made in the Medrash HaGadol. Avimelech was a perverted rasha and always kept an eye out to peep on them. Apparently one time he got what he wanted. This idea is further strengthened in the seffer Shaarei Aharon (from where I am quoting these answers) by pointing out Targum on the word Chalon is 'charka' which Targum uses exclusively as a type of spying or viewing window, not a regular window for light or air. With this point he answers how Yitzchok could have behaved indecently, and of course Yitzchok was careful to be tznius from the regular neighbors windows, but Avimelech's peeping window was unexpected.