Have Mental Health Questions? Ask a Psychiatrist Online
If he appears moody to you at times and isolates, it may be due to depression. You may try find out if he had ever gotten treatment in the past, ask him if he is sleeping well (a sleep disorder can also trigger depressive symptoms and poor concentration) You could offer to go with him to see a professional.
If he does not want to talk about this issue with you, there is not much you can do, but try to talk to him when he is not having one of his episodes. You may have to find a way to cope with this if you're to remain with him and believe that he is not interested in getting help or engaging in introspection.