don't eat legumes all by themselves, except for edamame which causes less flatulence than other legumes. Chik peas also, are lower in flatulence-production than lentils, and beans. As are peanuts.
If you are eating lentils or beans, eat them with rice, brown or white. Always eat 2 parts rice to one part lentils or beans or rehydrated dried peas (peas can be whole or split).
Eating beans in succulent stage, steamed, is less flatulatating than eating rehydrated dry beans.
The 2 part rice to one part white beans or lentils or split peas, works out nicely. You can eat pasta and beans too, either whole durum wheat or durum wheat semolina. Same ratio. Pasta has about twice as much protein than rice.
If you do rice and lentils you can add some steamed vegetables and some kind of sauce to them.
I often like to limit to one steamed vegetable. Just snap peas (when I grow them), or just steamed red sweet peppers. Avoid adding onion or sulfurous (cabbage family) vegetables such as kale, brocolli, or turnips. If you eat these vegetables, eat them with plain rice, no legumes.