Book of Matthew:  Chapter 7:24-27

Book of Luke:  Chapter 6:47-49
King James Version

Matthew 7:24-27

[24] Therefore whosoever heareth these sayings of mine, and doeth them, I will liken him unto a wise man, which built his house upon a rock:
[25] And the rain descended, and the floods came, and the winds blew, and beat upon that house; and it fell not: for it was founded upon a rock.
[26] And every one that heareth these sayings of mine, and doeth them not, shall be likened unto a foolish man, which built his house upon the sand:
[27] And the rain descended, and the floods came, and the winds blew, and beat upon that house; and it fell: and great was the fall of it.
[28] And it came to pass, when Jesus had ended these sayings, the people were astonished at his doctrine:
[29] For he taught them as one having authority, and not as the scribes.

Luke 6:47-49

[47] Whosoever cometh to me, and heareth my sayings, and doeth them, I will shew you to whom he is like:
[48] He is like a man which built an house, and digged deep, and laid the foundation on a rock: and when the flood arose, the stream beat vehemently upon that house, and could not shake it: for it was founded upon a rock.
[49] But he that heareth, and doeth not, is like a man that without a foundation built an house upon the earth; against which the stream did beat vehemently, and immediately it fell; and the ruin of that house was great.