Nationality vs race

I'm kind of confused on what I say when someone asks what are you? I live in USA but my mother grew up in Germany and my father grew up here in America. I lived in Germany until I was 6mo old. My friend told me that I cannot claim Germany that I am just white, but then I brought up that she calls herself puerto rican when both of her parents grew up in USA. Only one of her grandparents is from puerto rico. On government paperwork she has to check black and I check white because that's our race. I'm just truly confused why do people say oh no shes white but I'm puerto rican. Why can't I claim where half of my family is from but she can claim a place only 1/4 of her family is from? Can I not say I'm German American? Race and nationality are different right??? Not trying to step on any toes. Just trying to understand.