A creature mostly obscured from line of sight (standing behind a tree, a larger ally, a knocked over table, in poor lighting, etc.) has Cover and imposes disadvantage on attacks against them. A creature completely obscured from view has Full Cover and cannot typically be targeted by an attack.
Cover
Core Rules v2 p. 8
Related Rules
6Advantage & DisadvantageFundamentals / Stats, Skills & Checks
AttackCombat / Actions
ConditionsReference / Indexes
HidingCombat / Positioning & Control
Opportunity AttackCombat / Reactions
SkillsFundamentals / Stats, Skills & Checks