Customs at refueling stops? This question has me wondering: do passengers/crew have to to through customs at refueling stops?

Does it matter if they stay in/with the aircraft vs. going into the FBO, e.g. to use restrooms?

If it is different for different types of flights (e.g. airline vs private), please answer for each.
It depends on the country and may depend on the airport - you have to check the AIP. The term "technical stop" or "tech stop" is often used instead of "refuelling stop", since I guess there could be other reasons than refuelling why you'd need to land and takeoff without exchanging passengers or cargo.

As an example from personal experience flying my 2-seat experimental across the pond, Kangerlussuaq and Narsarsuaq in Greenland do not require crew to go through any customs or immigration checks for a technical stop, while Reykjavik in Iceland does. They let me get out of my drysuit and take a pee break first though, unlike the US CBP!