Do taking certain medications lower sperm count

Before my boyfriend and I met he was very depressed so he would take certain medication such as depression pills I'm not sure what they were called but he was taking them for 6 years. He stopped already and we're still trying for our first baby. I asked the ob gyn she told me no it shouldn't. But I read online that it can hoping that's not the case.