The 400as are the ,IMHO, the worst ones to have elec problems.You will need a full service manual. It could anything from the stator, cdi ,change switch,or change switch rely,for starters. There is a sticky in the 400 elec section you should read before starting on it.
I had the same problem on a new to me cb 400 a and it was a bad stator. i would check everything else before looking at the cdi. If turns over with the starter its probably not the change switch or rely. I would start at the stator.