Both constructions are possible, but their meaning is different:
If you have attended every lesson, only the songs need to be rehearsed at home.
In this case, only applies to the songs (and 'songs' will be emphasized). Perhaps there were other things discussed during the lessons than songs, e.g.
dance moves. You only need to rehearse the songs, not the dance moves.
If you have attended every lesson, the songs only need to be rehearsed at home.
In this case, only applies to the rehearsal (and 'rehearsed' can be emphasized). I.e. the instruction is that you only need to rehearse the songs, but not write an arrangement for them.