The reason why rinsing beans reduces gas is because when you rinse the beans it removes some of the oligosaccharides which are sugars that the body has trouble digesting properly.
When the body cannot digest the oligosaccharide sugars properly it leads to gas buildup in the stomach and intestine and leads to flatulence.
When the beans you eat reach your large intestine, bacteria break the beans down which produce gas.
Soaking the beans removes some of the oligosaccharides and makes it easier for your body to digest the beans.
To reduce gas in the beans you should soak the dried beans in some water for 8 to 12 hours and change the water every 3 hours.
You can also boil the beans for a few minutes before soaking them to reduce gas.
After you soak the beans in water you should drain and rinse the beans until the water runs clear.
You can also add a bit of baking soda to the water while soaking the beans which also helps reduce the amount of gas causing oligosaccharides in the beans.
If you're eating canned beans without sauce you can also rinse the canned beans before eating to reduce gas.
And drink more water each day when you eat beans to help reduce gas buildup in your stomach.