Learn こもって in the app in under 3 minutes
JLPT N2 · Question 509
Well done, that is the right answer.
失恋した彼は、部屋にこもって泣いていた。