the latter
Can i be a chess master by using chess.com

To be recognized by a national or international chess organization, you have to participate in that organization's tournaments.
I.e. you can't earn a NM (national master) or FM (FIDE master) title by playing on chess.com.
If you mean something more vague like playing at the level of master, then the answer is yes, but not likely.
or would i need to go to a tournament?