What am I?

My tail is long, my coat is brown. I like the country, I like the town. I can live in a house or live in a shed, and I come out to play when you are in bed. What am I?