It's more difficult than for normal people but far from impossible.
Some things to consider from my person experience:
1. Exercise timing. It seems that for many of us, IBS symptoms are worse in the morning, so working out later in the day may be better.
2. Diet - keep your protein intake high with FODMAP friendly foods - I drink a lot of lactose free milk mixed with unflavoured whey protein isolate (isolate for low lactose content, unflavoured for lack of artificial sweeteners). This will help you build muscle and strength. Carefully examine the ingredients of any workout supplements you take because many contain things that can aggravate symptoms. Also, if you suffer from an overactive gastrocolic reflex, then don't eat too close to your workout.
3. Intensity/enjoyment. I have found that if exercise is particularly engaging, I sometimes achieve
flow, during this time I totally forget about my IBS.
4. Medication. Sometimes if things are going particularly badly internally I'll take some imodium before the gym.
That's all I can think of for now, PM me if you have any other questions. When I'm feeling down about my symptoms holding me back, I try to re-frame my thinking like this: if I can become even half as fit/strong/big as an ordinary person can, while dealing with this horrible illness, that's pretty damn impressive and something to be proud of.