My dad has a medium-sized dog. She was adopted when she was a puppy, and is now about 6 years old. When she was younger (until about 3 years old) I used to visit a few times a year but now it's only about once a year, after I moved farther away.
Although I'm in no way an expert in interpreting dog behaviour, she generally seems to remember me, and also be very happy to see me. When I walk in she starts barking, wagging her tail and jumping all around me. She likes it when I pet her, and some times she comes asking for it as well, by lying on my legs when I'm sitting down.
When I talk to my dad (and others in the household) through Skype, if she's in the room and hears my voice she'll come up to the computer and start doing a bark-bark-howl, which I've read somewhere is dog for "Come back!".
However her behaviour changes entirely if we're alone in the house, or if everyone else is asleep.
When she was little (before she started being so friendly with me in general) if I went downstairs to use the bathroom, which is next to my dad's bedroom where she sleeps, I'd hear her making a low growl interspersed with a sound that's something between a bark and a snort (or maybe a bark without opening her mouth). My dad woke up and said that while she was doing that, she was pressed up against him and trembling. Eventually that stopped.
One day, last time I visited, we were out and I approached the house before my dad did. She was barking from the inside, the same way she barks at strangers. When my dad came close, she stopped. We went in and she was happy to see us both, but when my dad stepped out she ran behind a corner and stared at me making the same growl-bark/snort sound I described earlier. It stopped immediately when my dad came back in.
I've never had a dog myself so I'm not very familiar with their behaviour. It seems though that she genuinely likes me when others are around, rather than just thinking my presence is acceptable, but looks afraid when no one else is.
What could explain that behaviour?