for example, could a family be prosecuted for singing happy birthday? and if a band sang happy birthday with instruments? what is the difference in the courtroom. is it as long as the band doesnt get paid/promotion/some gain by playing it.
The difference is in whether the copyright work is "performed publicly."
Section 106 of the Copyright Act identifies the "exclusive rights" that a copyright holder has in a musical composition (or any other copyrighted work). Among other things, section 106 says that "the owner of copyright ... has the exclusive rights to do and to authorize any of the following ... (4) in the case of ... musical ... works, ... to perform the copyrighted work publicly."
What does it mean to perform a copyrighted work "publicly"? That is defined is section 101 of the Act: "To perform or display a work 'publicly' means ... to perform or display it at a place open to the public or at any place where a substantial number of persons outside of a normal circle of a family and its social acquaintances is gathered ...."
Thus, the performance of a copyrighted work in a bar, which is "a place open to the public" is a right that is specifically reserved to the copyright holder, and if that performance is not expressly permitted by the copyright holder, it may be an infringement under the Copyright Act. The performance of a copyrighted work in one's house at a birthday party consisting entirely of a "normal circle of a family and its social acquaintances," on the other hand, is not a an exclusive right that is reserved to the copyright holder because it is not a public performance.
One thing that is worth noting is that the Copyright Act grants the copyright holder the exclusive right "to perform the copyrighted work publicly." That right is not defined in terms of whether the work is being performed for a profit or not. At least in section 106, the Copyright Act does not make any distinction between the performance of a copyrighted work publicly for free and the performance of a copyrighted work publicly for a profit or for some other commercial purpose. Section 107 of the Copyright Act contains the "Fair Use" exception, which
does take into account whether the use of the copyrighted work is for a commercial purpose, but that is just one of four factors that are evaluated in determining whether something is "fair use."
Note that all of this assumes that we are talking about the
United States Copyright Act.