"I see someone in the house."
Translation:Widzę kogoś w domu.
Widzieć requires accusative which has two question tags: „kogo?” and „co?”. With them one constructs questions. If we add "-ś" to them we end with „someone” and „something” suitable for accusative case. Similarly:
Nominative: Kto? Co? -> Ktoś, Coś
Genitive: Kogo? Czego? -> Kogoś, Czegoś
Dative: Komu? Czemu? -> Komuś, Czemuś
Accusative: Kogo? Co? -> Kogoś, Coś
Locative: Kim? Czym? -> Kimś, Czymś
Instrumental: Kim? Czym? -> Kimś, Czymś
"W domu widzę kogoś" - if sentence order is flexible, surely this should also be accepted?
Well, it's grammatical, but a bit strange. It's like "In the house I see someone". It's hard to find a reason for such a word order.
Do not exaggerate with the flexible word order. Some things may be grammatical, but simply unusual or poetic. And some things are just wrong.