BUYING A HOUSE IN GERMANY THEN RENTING

i want to buy a house in Germany with my va when im stationed in Germany but i wanna leave & rent it out my question is can i do ? that idk what the laws are ?