First of all, let me point out that you need
(i) to enclose direct speech in quotation marks,
(ii) to begin every sentence with a capital letter,
(iii) to use an apostrophe in the word “didn’t”, and
(iv) to end every sentence with a full stop:
“Why didn’t you come to the party ?” Bill asked Tom.
In reported speech, you can say either Bill asked Tom why he hadn’t gone to the party or Bill asked Tom why he hadn’t come to the party. IMHO, It depends on whether the speaker of the reported speech was at the party. If the speaker was at the party, “come” would be used, whereas “gone” would be used if the speaker was not at the party.