I am a 100 P&T veteran and I receive SSDI benefits. I want to know the rules for investing in stock and capital gains and IRS taxes on withdrawals on stock.
You're asking me to cover an awful lot of ground...hundreds and hundreds of pages of rules and regulations that may apply here. Rather than asking me to lay out a few dozen links to the IRS, the SSA and a a bunch of banking and investment sites you'll be better served by starting to learn about investing by joining one of the brokerage sites, setting up an account and beginning to do a couple of small trades.
Start low, go slow and as you get a feel for what you're doing, use Google to research any questions you may have along the way.