When I saw a Subaru that some shops said had a leaking oil pan, the oil was actually coming from somewhere else. Around the back of the engine you have the crankshaft seal and spacer plate. The sides of the oil pan may be head gaskets or coming off the rear camshaft seals. The front of the engine can be the front axle seal or oil pump. Oil pump issues are generally really high mileage engines.
If you’re asking because you’re taking the engine apart and part of that is removing the oil pan, use 3M Ultra Gray. Make sure the block and pan are clean and dry with no oil and use a really thin bead of RTV. Let it sit for about 5 minutes before placing the pan on the block.