Read the problem on LeetCode. You are given a binary tree and nodes p and q that are guaranteed to exist in the tree. Return their lowest common ancestor. Pay attention to the constraint: all node values are unique, and p != q.
Think about what information you need from each subtree. If you find p in the left subtree and q in the right subtree, what does that tell you about the current node? If you only find one target in a subtree, what should you return? Consider the base cases: what happens when you reach a null node, or when the current node is one of the targets?