I would do it like this;
if CONTAINS([Lineofbusiness],"A") then ",A" else "" end +
if CONTAINS([Lineofbusiness],"B") then ",B" else "" end +
The MID function ensures you remove the leading trail off the first comma which is returned by the field.
Place your mouse over the squiggly line to see why you're getting an error. I can tell from looking at it, you've got another plus symbol at the end of line three but you're not "adding" it to anything after that symbol.
Make sure you have a comma in front of your global shareholder services in the second line too.