I'm working away from home so won't have a picture before the weekend. But simply, the carpet is glued to the metal work (it stretches to follow the contours) and when you cut it off you leave enough to tuck under the rubber seals around the windows. You lift the seal with a finger or blunt screwdriver and tuck it under - hey presto, neat edges.
On the slider and tailgate, you can do the same at the window, but the edges that are on the outer edge of the doors have no natural edge or seal to tuck under. You wouldn't want them getting caught in the actual door seal as they might wick water in and make you carpet filthy and stinky.
E D I T.... sorry I have just looked again, you have an open double skinned edge - was it a panel van tht was cut for windows? Mine is joined together giving a single lip. You could tuck the carpet over the edge and into the gap, then do the outer skin as above? You can also get push on rubber edging for finishing cut edges etc, this could tidy it all up. You could use a generic door seal as they come in various sizes, this would slip over the front lip and the rubber seal bit would bridge the gap and press against the outer panel. Done right it could look ok, giving thr impression of a thicker black edge on the window. It wiuld stop crud and moisture getting between the panels..