How to trim exterior basement window
Based on that pic, I'd agree with the comment that some small stock, ripped to the appropriate width to fill that gap is going to be your only way to trim that out. Personally, I'd suggest using PVC &quot;wood&quot; as it's guaranteed to never rot (since it's not wood). If you want to stick with real wood, I'd suggest that investing in pressure treated at a minimum or possibly something like cedar that is naturally rot resistant, then, once each piece is cut to fit, prime all six sides with a quality primer (don't skimp here or you'll be replacing it sooner than you'd like) before installation and paint the outside the appropriate color after installation.
I'd decide how far out from the concrete you want it to stick, then get the appropriate thickness (or build it up out of layers if using PVC - it usually only comes in nominal 1&quot;), rip pieces to width to fit into the narrow gaps, then either use wider pieces (where you have the room) that match the width of your other window trim or use the same width as this narrow gap has where you don't have the room.
For the side shown in the picture, I'd put a heavy bead of caulk down the side of the concrete, and another down the side of the window, then push the trim into the caulk and use the appropriate screws to attach it to the wall. I purchased a kit of screws that came with a driver bit with a depth stop and little white PVC plugs that just fill the holes when the screws are driven to the proper depth.
For the bottom trim, depending on how far above ground this is, you may want to leave the caulk off the bottom, so that any moisture that manages to get behind the trim has a place to escape. If this is very close to the ground, I'd put caulk along the bottom there to prevent moisture from wicking in should there ever be any flooding or snow build up in the window well.