Constraints on scalar-tensor theories of gravity from observations