きのうわたしのうちにおきゃくさんがさんにんきました。
This is perfectly correct and natural (except that you used no kanji).
きのうおきゃくさんさんにんはわたしのうちにきました。
So you made three changes: 1) used は instead of が, 2) moved さんにん, and 3) moved わたしのうちに. Among this, 3) is perfectly okay, but you usually should not do 2), and you should never do 1).
- You have to use が instead of は because "guests" has not been introduced in the discourse (See: What's the difference between wa (は) and ga (が)?).
- さんにん is basically adverbial (i.e., modifies a following verb), so it is usually placed somewhere between が and きました. Instead, you could have said さんにんのおきゃくさん to say "three guests" like in English, although it might sound a little stiff and unnatural in a casual conversation (See: How to list numbers of things)
The following sentences are valid alternative ways to say the first one:
- 昨日お客さんが3人私のうちに来ました。
(きのうおきゃくさんがさんにんわたしのうちにきました。)
- 私のうちに昨日3人のお客さんが来ました。
(わたしのうちにきのうさんにんのおきゃくさんがきました。)
Well also In the first sentence GA is used after the word for guests but before stating how many there are whilst in the next one WA is used after saying 3 guests
– Pmckeown2 Apr 26 '20 at 11:24