After finding the cavities for "the boys", pull the penis back and under the torso, towards the butt. Don't just flop it back, it must be mildly taut. I can't find my cavities with fingers, but "the boys" go right in; it's easier now after a few months on HRT, before it was a little uncomfortable. To put them in: While standing, let them hang free and lift them straight up at the same time. They should fit to either side of, and just behind, the base of the penis.
Put on either a 2-sizes too small undies, or "body-shaper" nylons with the legs mostly cut off (leave about 1"-2" of leg-fabric). Pull on the back of the nylons, thru the leg-holes and near the crotch, to make the front area TIGHT against the organs...while holding this tight, remove the hand which was holding things in place, and use it to snug up the undies/nylons all around. This holds me in even during long shifts.
If chafing is a problem (and believe you me, you don't want chafing!), use 3-4 squares of soft toilet paper...fold them into a trapezoidal shape (think triangle with one corner cut off), and place it between the penis and the fabric. If needed, make 2 more and put them at the thigh contact line.
If everything is snug, nothing should move. I've even swam for almost 2 hours without dislodging anything.