They didn't as far as we can tell.
They targeted an office for journalist after warning the journalists,
https://apnews.com/article/israel-we...e5fc2f8c7d8a79 - that's not how you target journalists.
Whether Hamas actually used the same house or not isn't clear; it's a convenient excuse for Israel to reduce the coverage of the conflict, but it's also convenient for Hamas to use the same building as journalists to hide (both because it's less likely to be targeted, and also because it was a tall building with a good view).