New To Foster Parenting. What Do I Do?

So me and my husband tried to have a baby for 8 years.. I've had more miscarriages than fingers on my hand. Finally we decided we want to be Foster parents. We went through the process and got approved and everything. The child that was to come to us is a 14 year old boy. He's been with us for a month... And well... Its been difficult. I can tell he has a lot of baggage. The first night he stayed with us he wet the bed. Instead of telling us he tried to hide it but I found the sheets. When I asked if he had an accident he broke down saying he was sorry and acting like I was gonna hit him. I would never put my hands on a child so IDK why he thought that I would hurt him just because he had an accident. The bed setting continued so we got him goodnites. They're like pull ups for older kids. We decided to home school him but he gets so frustrated. Especially in math. He will just throw his pencil and say he can't do it. We took him to see my mom and she has a lot of cousins over. He got freaked out locked himself in the bathroom and had an anxiety attack. My husband talked to him gently to get him to come out. We knew right then we had to leave. I am not sending him back to the system. I just need advice on how to handle this and why he may be acting like this. We had another issue where he fell in the shower. I went to help him. I didn't know he wasn't cover. When I went in I accidentally saw marks on his thighs and between his thighs. He quickly covered up. I asked where tht came from but he won't talk about it. Does anyone know why marks might be between his thighs? I just need advice on everything. I want him to feel loved and nurtured. How can I do that?