"I go from my house to the office by subway."
In English we use Prepositions (in, of, from, to, etc.) before the noun, but in Japanese the noun is followed by its connecting word so it is postpositioned.
Lets break up the sentence:
- I (Subject)
- go (Verb)
- from + my house (Preposition + Object)
- to + the office (Preposition + Object)
- by + subway (Preposition + Object)
To translate to Japanese we adjust the parts order for grammar and turn it from pre to postposition by flipping the pairs:
- I (Subject)
- my house + from (Object + Postposition)
- the office + to (Object + Postposition)
- the subway + by (Object + Postposition)
- go (Verb)
- (私は) : (I - implied with context so not needed)
- いえ から (my house from)
- かいしゃ まで (the office to)
- ちかてつ で (the subway by)
- 行きます : (go)
They don't reply to the comments here, but if you use the "report" option then I have gotten messages from them saying that they changed things to accept different translations that I suggested. Recently I have been getting quite a few replies to things I've reported in the past, so I think they are starting to get better about it now.
を marks the direct object, so you can't use it here. The direct object is what the verb is acting on, so for example in the sentence, "I eat pizza", or ピザをたべます, the pizza is what you're eating. But in "I go by subway", you aren't "going" the subway, you're just going, and "the subway" is extra information about how you're going. In English we can indicate this by using the word "by", while in Japanese they use the particle で which is used in many circumstances to indicate the idea of "by means of" or "by using".
Another couple examples:
はしをたべます - "I eat chopsticks" (を particle means はし is the direct object)
はしでたべます - "I eat using chopsticks" (で means that はし is extra information about how the action in the verb is being accomplished)
To expand on the explanation by asterlea, the reason you can't use を with 行きます is because 行く is an intransitive verb, meaning it cannot take a direct object (marked by を). You can't really "go" "a thing" if that makes sense. But you can "go" "by way of a thing", which is what で is saying as already explained.
In technical terms, で in this context denotes the instrumental case. English doesn't really do cases except for personal pronouns, so it will usually be translated into some sort of prepositional phrase ("by subway" in this example). Wikipedia has an article on the instrumental case here: https://en.wikipedia.org/wiki/Instrumental_case
行う (おこなう) on the other hand is a transitive verb that doesn't literally mean "to go", but uses the same kanji (in case you've seen [something]を行[some inflection] and wondered why it was fine then and wrong in this example) and can take a direct object.
Kanshudo has an example sentence here: https://www.kanshudo.com/example?id=102372&oq=行う
It breaks the sentence down with word meanings, readings, and parts of speech, but I'll transcribe the sentence below in case the site is inaccessible.
みぎ の みち を おこなってください。
Take the road on the right.
If you want a deeper look at transitive vs intransitive verbs in Japanese specifically, Tofugu has an article with much better examples of intransitive/transitive verb pairs than 行く and 行う to illustrate the difference. You can find it here: https://www.tofugu.com/japanese/transitive-intransitive-verbs/