There is no surefire way to stop your guinea pig from marking his enclosure but some things that may help are wearing gloves when handling them, hiding food in hidden areas, and providing a small piece of fleece or towel, or their favourite toy, to keep them occupied.