It's not quite that simple and it's different for each guy/couple.
Some never do, and live in sexless marriages.
Others have occasional sex with their wife - it's a case of when you're horny, you'll screw anything.
Some guys fantasise about men while having sex with their wife.
There are guys who are attracted to men, but who fell in love with a woman and she's the only woman they're attracted to. They often fixate on one or two things about her - boobs, lips, legs, voice, hair... and that's enough to get them by.
To some guys a partner is a wank with skin attached. They just focus on themselves and she's just a fleshlight with extra bits.
Plenty of other couples use roleplay and toys - again, when you're worked up and horny, you'll screw anything.
Then, there are the guys who resort to drink, drugs, porn, aphrodisiacs etc. If you're drunk, either you'll screw anything or you've got the excuse of brewer's droop. Same with drugs. Porn gets you turned on to the point where you'll screw anything...
Other couples get into group sex, swinging, dogging - not to say that every guy who does is a closeted gay man, but some are.
There are probably as many ways of doing it as there are gay men who are married to women.