I play piano.

Sometimes I play piano at home. Do you need definite artical in front of piano? If so, how come we say I go to school instead of I go to the school?

Thanks.

Use of the definite article with instruments is a special case:
Joe plays the piano really well.(= Joe can play any piano)
She is learning the guitar.(= She is learning to play any guitar)
However, ‘I play piano’ and ‘I play the piano’ are both acceptable, the first being a little more general than the second, and the second being most common unless you are listing a range of instruments ("I play piano, guitar and cornet.)

With ‘go to’ + a place (e.g. school), the general term is ‘I go to school’
. ‘I go to the school’ would only be used if you were speaking about one specific building.
Every weekday I go to school.
I go to the school (a specific school, known to the speaker and listener) to use their gym on Wednesday nights.

Are you saying the first one is more general, and the second one is more common? I am confused. Thanks.

No, I’m saying that when you talk about playing an instrument it’s an unusual case.