Lillis, 23, has made 26 appearances for the Iron after coming through the club's youth scheme.
He has been backup to Joe Murphy for all of his time as a professional at Glanford Park, and has also had loan spells at Grimsby Town and Notts County. He played once for Rochdale on loan last season.
"This is good news for me and I'm delighted Rochdale have come in for me again," Lillis told Rochdale's official website.
"Despite only being here for a short spell last season I enjoyed it and I felt very comfortable here.
"Every player wants to play and I'm no different, although when you're an outfield player on the bench you could get a game outside of your orthodox position. Sadly goalkeepers don't get that chance so it is very unlikely you'll get a game and it gets frustrating to be sat watching all the time."