The following methodology almost never fails.
1. Construct free body diagrams of relevant objects
2. Write equations of motion of relevant objects in convenient coordinate systems. In this case there should be 3:

.....projectile

.....projectile

.....target
3. Articulate what you want to know/do. In this case
4. Use what you know to get what you want
- one of the 3 equations allows t to be elimiated from the other equations
- the other 2 should relate y1, y2, and theta. Be careful how you relate y1 and y2 to each other. Net result is that you should be able solve theta in terms of known parameters